diff options
author | Tyrannova <daniel.sluga@grb-online.net> | 2019-01-17 23:20:41 +0100 |
---|---|---|
committer | Tyrannova <daniel.sluga@grb-online.net> | 2019-01-17 23:20:41 +0100 |
commit | 0dbfc25385db3df3cfb0d7500e285795f50f4387 (patch) | |
tree | 69d53ef22359fed3f138f21c618ac23253d215bf /src/main/kotlin/de/romjaki/pluggabledino | |
parent | b90e6a47911902cee91cbda1ccb2f184cbcb1a21 (diff) | |
download | pluggabledino-master.tar.gz pluggabledino-master.tar.bz2 pluggabledino-master.zip |
Diffstat (limited to 'src/main/kotlin/de/romjaki/pluggabledino')
-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 } |