diff options
-rw-r--r-- | src/main/kotlin/de/romjaki/pluggabledino/game/GameWorld.kt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/game/GameWorld.kt b/src/main/kotlin/de/romjaki/pluggabledino/game/GameWorld.kt index 3775faa..3375c92 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/game/GameWorld.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/game/GameWorld.kt @@ -170,9 +170,16 @@ class GameWorld : ContactListener { cacti.forEach { it.linearVelocity.set(-delta * speed, 0f) } + cacti.removeIf { + it.position.x < 0 + } + birdd.forEach { it.linearVelocity.set(-delta * speed, 0f) } + cacti.removeIf { + it.position.x < 0 + } world.step(delta, 4, 3) world.setContactListener(this) |