|
|
@ -24,7 +24,8 @@ bool Meteos::OnUserCreate() |
|
|
|
coinFlip=std::uniform_int_distribution<>(0, 1); |
|
|
|
coinFlip=std::uniform_int_distribution<>(0, 1); |
|
|
|
comboOverlayOffset=std::uniform_int_distribution<>(-16,16); |
|
|
|
comboOverlayOffset=std::uniform_int_distribution<>(-16,16); |
|
|
|
|
|
|
|
|
|
|
|
gameBoard=Board({10,14},0.02f,0.04f,1.2f,0.04f,0.4f,{-1.f,-1.5f,-2.f,-2.5f,-4.f},1.7f,2.0f,1.0f,{3,3,1,2,3,0,0,0,0,0},SPRITES["blocks_test.png"]); |
|
|
|
gameBoard=Board({10,14},0.02f,0.04f,1.2f,0.04f,0.4f,{-1.f,-1.5f,-2.f,-2.5f,-4.f},1.7f,2.0f,1.0f,{3,3,1,2,3,0,0,0,0,0}, |
|
|
|
|
|
|
|
60*10,SPRITES["blocks_test.png"]); |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -614,7 +615,15 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool noWarning=true; |
|
|
|
for (int i=0;i<gameBoard.boardSize.x;i++){ |
|
|
|
for (int i=0;i<gameBoard.boardSize.x;i++){ |
|
|
|
|
|
|
|
if (gameBoard.getBlocks(i).size()>=gameBoard.boardSize.y){ |
|
|
|
|
|
|
|
gameBoard.warningFlashingLevel[i]+=fElapsedTime; |
|
|
|
|
|
|
|
gameBoard.warningLevel++; |
|
|
|
|
|
|
|
noWarning=false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
gameBoard.warningFlashingLevel[i]=0; |
|
|
|
|
|
|
|
} |
|
|
|
for (int y=gameBoard.getBlocks(i).size()-1;y>=0;y--){ |
|
|
|
for (int y=gameBoard.getBlocks(i).size()-1;y>=0;y--){ |
|
|
|
Block&b=gameBoard.getBlocks(i)[y]; |
|
|
|
Block&b=gameBoard.getBlocks(i)[y]; |
|
|
|
b.addedToLaunchList=false; |
|
|
|
b.addedToLaunchList=false; |
|
|
@ -624,6 +633,22 @@ void Meteos::updateGame(float fElapsedTime){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (noWarning){ |
|
|
|
|
|
|
|
gameBoard.warningLevel=0; |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
if (gameBoard.warningLevel>=gameBoard.maxWarningLevel){ |
|
|
|
|
|
|
|
//Planet crashes! For now we just clear all blocks and clumps on the board.
|
|
|
|
|
|
|
|
while (gameBoard.getBlockClumps().size()>0){ |
|
|
|
|
|
|
|
gameBoard.removeClump(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (int i=0;i<gameBoard.boardSize.x;i++){ |
|
|
|
|
|
|
|
while (gameBoard.getBlocks(i).size()>0){ |
|
|
|
|
|
|
|
gameBoard.removeBlock(i,0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
gameBoard.warningLevel=0; |
|
|
|
|
|
|
|
goto invalidatedExit; |
|
|
|
|
|
|
|
} |
|
|
|
//Invalidate the selected block if something is strange about it.
|
|
|
|
//Invalidate the selected block if something is strange about it.
|
|
|
|
if (gameBoard.selectedBlock.col!=-1){ |
|
|
|
if (gameBoard.selectedBlock.col!=-1){ |
|
|
|
if (gameBoard.selectedBlock.c!=-1){ |
|
|
|
if (gameBoard.selectedBlock.c!=-1){ |
|
|
@ -674,6 +699,9 @@ void Meteos::drawGame(float fElapsedTime,bool debugView){ |
|
|
|
Block&b=gameBoard.getBlocks(i)[y]; |
|
|
|
Block&b=gameBoard.getBlocks(i)[y]; |
|
|
|
DrawPartialDecal(b.pos+gameBoard.drawOffset,gameBoard.tileset,{(float)(int)b.col*12,0},{12,12},{1,1},gameBoard.selectedBlock.col!=-1&&gameBoard.selectedBlock.c==-1&&gameBoard.selectedBlock.col==i&&gameBoard.selectedBlock.ind==y?Pixel(GREY.r,GREY.g,GREY.b,alpha):Pixel(WHITE.r,WHITE.g,WHITE.b,alpha)); |
|
|
|
DrawPartialDecal(b.pos+gameBoard.drawOffset,gameBoard.tileset,{(float)(int)b.col*12,0},{12,12},{1,1},gameBoard.selectedBlock.col!=-1&&gameBoard.selectedBlock.c==-1&&gameBoard.selectedBlock.col==i&&gameBoard.selectedBlock.ind==y?Pixel(GREY.r,GREY.g,GREY.b,alpha):Pixel(WHITE.r,WHITE.g,WHITE.b,alpha)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (gameBoard.warningFlashingLevel[i]>0){ |
|
|
|
|
|
|
|
FillRectDecal({gameBoard.drawOffset.x+i*12,gameBoard.drawOffset.y},{12,(float)gameBoard.boardSize.y*12},Pixel(255,64,64,std::abs(sin(gameBoard.warningFlashingLevel[i]*M_PI))*128)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i=0;i<comboDisplayList.size();i++){ |
|
|
|
for (int i=0;i<comboDisplayList.size();i++){ |
|
|
|
ComboOverlay&c=comboDisplayList[i]; |
|
|
|
ComboOverlay&c=comboDisplayList[i]; |
|
|
|