summaryrefslogtreecommitdiff
path: root/src/main/kotlin/de/romjaki/pluggabledino/api
diff options
context:
space:
mode:
authorTyrannova <daniel.sluga@grb-online.net>2019-01-17 23:20:41 +0100
committerTyrannova <daniel.sluga@grb-online.net>2019-01-17 23:20:41 +0100
commit0dbfc25385db3df3cfb0d7500e285795f50f4387 (patch)
tree69d53ef22359fed3f138f21c618ac23253d215bf /src/main/kotlin/de/romjaki/pluggabledino/api
parentb90e6a47911902cee91cbda1ccb2f184cbcb1a21 (diff)
downloadpluggabledino-0dbfc25385db3df3cfb0d7500e285795f50f4387.tar.gz
pluggabledino-0dbfc25385db3df3cfb0d7500e285795f50f4387.tar.bz2
pluggabledino-0dbfc25385db3df3cfb0d7500e285795f50f4387.zip
birds arent realHEADmaster
Diffstat (limited to 'src/main/kotlin/de/romjaki/pluggabledino/api')
-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
}