|
|
@ -24,6 +24,17 @@ bool Meteos::OnUserCreate() |
|
|
|
bool Meteos::OnUserUpdate(float fElapsedTime) |
|
|
|
bool Meteos::OnUserUpdate(float fElapsedTime) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fElapsedTime=std::min(fElapsedTime,1/60.f); |
|
|
|
fElapsedTime=std::min(fElapsedTime,1/60.f); |
|
|
|
|
|
|
|
if (!onlyOnce) { |
|
|
|
|
|
|
|
BlockClump c; |
|
|
|
|
|
|
|
c.addBlock(1,0,BlockColor::RED); |
|
|
|
|
|
|
|
c.addBlock(2,0,BlockColor::RED); |
|
|
|
|
|
|
|
c.addBlock(0,0,BlockColor::RED); |
|
|
|
|
|
|
|
c.addBlock(0,1,BlockColor::RED); |
|
|
|
|
|
|
|
c.addBlock(0,2,BlockColor::RED); |
|
|
|
|
|
|
|
c.y=120; |
|
|
|
|
|
|
|
gameBoard.addClump(c); |
|
|
|
|
|
|
|
onlyOnce=true; |
|
|
|
|
|
|
|
} |
|
|
|
lastBlockSpawn+=fElapsedTime; |
|
|
|
lastBlockSpawn+=fElapsedTime; |
|
|
|
if (lastBlockSpawn>=gameBoard.spawnRate){ |
|
|
|
if (lastBlockSpawn>=gameBoard.spawnRate){ |
|
|
|
lastBlockSpawn-=gameBoard.spawnRate; |
|
|
|
lastBlockSpawn-=gameBoard.spawnRate; |
|
|
|