From 2e5a4ca26efbbf6e6c045fa605c3636f914acdee Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Fri, 7 Aug 2015 11:48:23 +0200 Subject: [PATCH] bugfixes --- core/src/com/mygdx/game/Game.java | 4 ++-- core/src/logic/Creature.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/com/mygdx/game/Game.java b/core/src/com/mygdx/game/Game.java index 047dc84..b28d562 100644 --- a/core/src/com/mygdx/game/Game.java +++ b/core/src/com/mygdx/game/Game.java @@ -67,9 +67,9 @@ public class Game extends ApplicationAdapter { @Override public boolean scrolled(int i) { if (i>0) { - renderer.scale(0.5f, 0.5f, 1); + renderer.scale(0.9f, 0.9f, 1); } else { - renderer.scale(1.5f, 1.5f, 1); + renderer.scale(1.1f, 1.1f, 1); } return true; } diff --git a/core/src/logic/Creature.java b/core/src/logic/Creature.java index 4327d0e..a5a618e 100644 --- a/core/src/logic/Creature.java +++ b/core/src/logic/Creature.java @@ -20,7 +20,7 @@ public class Creature extends Element implements Runnable { private Brain brain; private float dir, hp, prevHp, speed, fitness, rotSpeed, beak; - private boolean eating = false, killing = false, workerDone = false; + private boolean eating = false, killing = false, workerDone = false, killWorker = false; private Sight[] sights; private Thread workerThread; @@ -54,6 +54,7 @@ public class Creature extends Element implements Runnable { update(); workerDone = true; } + if(killWorker) break; } } @@ -70,6 +71,7 @@ public class Creature extends Element implements Runnable { carcass.setDecayRate(corpseDecayRate); Game.get().getWorld().add(carcass); } + killWorker = true; return; } if (speed > max_speed) {