FIX: SpaceInvaders: accumulated slowdown (when speeding up)
This commit is contained in:
parent
5dbfdbb129
commit
4030b9136a
@ -89,7 +89,7 @@ public:
|
||||
void stepRockets(microseconds_t dt) {
|
||||
rocketRuntime += dt;
|
||||
if (rocketRuntime > 200000) {
|
||||
rocketRuntime -= 200000;
|
||||
rocketRuntime = rocketRuntime % 200000;
|
||||
for (Rocket *rocket = rocketsBegin; rocket < rocketsEnd; rocket++) {
|
||||
if (rocket->alive) {
|
||||
if (rocket->y == 0) {
|
||||
@ -117,7 +117,7 @@ public:
|
||||
}
|
||||
|
||||
if (swarmRuntime >= 1000000) {
|
||||
swarmRuntime -= 1000000;
|
||||
swarmRuntime = swarmRuntime % 1000000;
|
||||
if (swarmLeft) {
|
||||
swarmX--;
|
||||
if (swarmX == 0) {
|
||||
@ -138,7 +138,7 @@ public:
|
||||
void stepHero(microseconds_t dt) {
|
||||
heroRuntime += dt;
|
||||
if (heroRuntime >= 50000) {
|
||||
heroRuntime -= 50000;
|
||||
heroRuntime = heroRuntime % 50000;
|
||||
if (heroLeft) {
|
||||
heroX--;
|
||||
if (heroX <= 1 || randomBool(20)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user