|
|
@ -13,7 +13,7 @@ bool Meteos::OnUserCreate() |
|
|
|
gen=std::mt19937(rd()); //Standard mersenne_twister_engine seeded with rd()
|
|
|
|
gen=std::mt19937(rd()); //Standard mersenne_twister_engine seeded with rd()
|
|
|
|
randBlockPos=std::uniform_int_distribution<>(0, 9); |
|
|
|
randBlockPos=std::uniform_int_distribution<>(0, 9); |
|
|
|
|
|
|
|
|
|
|
|
gameBoard=Board({10,14},0.1f); |
|
|
|
gameBoard=Board({10,14},6.f); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -35,6 +35,13 @@ bool Meteos::OnUserUpdate(float fElapsedTime) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
for (Block&b:blocks) { |
|
|
|
for (Block&b:blocks) { |
|
|
|
|
|
|
|
if (b.pos.y<gameBoard.yBottom) { |
|
|
|
|
|
|
|
b.vspeed+=gameBoard.gravity*fElapsedTime; |
|
|
|
|
|
|
|
b.pos.y+=b.vspeed*fElapsedTime; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
b.vspeed=0; |
|
|
|
|
|
|
|
b.pos.y=gameBoard.yBottom; |
|
|
|
|
|
|
|
} |
|
|
|
FillRectDecal(b.pos+gameBoard.drawOffset,{12,12},GREEN); |
|
|
|
FillRectDecal(b.pos+gameBoard.drawOffset,{12,12},GREEN); |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|