diff options
Diffstat (limited to 'src/main/kotlin/de')
-rw-r--r-- | src/main/kotlin/de/romjaki/pluggabledino/api/Emulator.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/api/Emulator.kt b/src/main/kotlin/de/romjaki/pluggabledino/api/Emulator.kt index a6e9aeb..04d3c66 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/api/Emulator.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/api/Emulator.kt @@ -3,10 +3,13 @@ package de.romjaki.pluggabledino.api import de.romjaki.pluggabledino.game.GameWorld object Emulator { - fun emulate(delta: Float, shouldJump: (GameWorld) -> Boolean): Float { + fun emulate(delta: Float, shouldJump: (GameWorld) -> Boolean, deleteBirds: Boolean): Float { val world = GameWorld() var score = 0f while (!world.hurt) { + if (deleteBirds) { + world.birdd.clear() + } world.update(delta / 1000f, shouldJump(world)) score += delta } |