summaryrefslogtreecommitdiff
path: root/src/main/kotlin/de/romjaki
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/de/romjaki')
-rw-r--r--src/main/kotlin/de/romjaki/pluggabledino/api/Emulator.kt5
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
}