mirror of
https://github.com/fazo96/AIrium.git
synced 2025-01-10 09:34:20 +01:00
bugfixes
This commit is contained in:
parent
e18cddebc7
commit
2e5a4ca26e
@ -67,9 +67,9 @@ public class Game extends ApplicationAdapter {
|
|||||||
@Override
|
@Override
|
||||||
public boolean scrolled(int i) {
|
public boolean scrolled(int i) {
|
||||||
if (i>0) {
|
if (i>0) {
|
||||||
renderer.scale(0.5f, 0.5f, 1);
|
renderer.scale(0.9f, 0.9f, 1);
|
||||||
} else {
|
} else {
|
||||||
renderer.scale(1.5f, 1.5f, 1);
|
renderer.scale(1.1f, 1.1f, 1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class Creature extends Element implements Runnable {
|
|||||||
|
|
||||||
private Brain brain;
|
private Brain brain;
|
||||||
private float dir, hp, prevHp, speed, fitness, rotSpeed, beak;
|
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 Sight[] sights;
|
||||||
private Thread workerThread;
|
private Thread workerThread;
|
||||||
|
|
||||||
@ -54,6 +54,7 @@ public class Creature extends Element implements Runnable {
|
|||||||
update();
|
update();
|
||||||
workerDone = true;
|
workerDone = true;
|
||||||
}
|
}
|
||||||
|
if(killWorker) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ public class Creature extends Element implements Runnable {
|
|||||||
carcass.setDecayRate(corpseDecayRate);
|
carcass.setDecayRate(corpseDecayRate);
|
||||||
Game.get().getWorld().add(carcass);
|
Game.get().getWorld().add(carcass);
|
||||||
}
|
}
|
||||||
|
killWorker = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (speed > max_speed) {
|
if (speed > max_speed) {
|
||||||
|
Loading…
Reference in New Issue
Block a user