01.11.2014, 16:41
Code:
@Override
public void update(int delta) {
// TODO Auto-generated method stub
super.update(delta);
if (getY() > Settings.HEIGHT - Settings.BOTTOM_WALL_OFFSET - 100) {
setStaticMovement(Direction.UP);
} else if (getY() < Settings.OUTER_BORDER_WIDTH + 50) {
setStaticMovement(Direction.DOWN);
}
int rnd = random.nextInt(spawnChance);
if (rnd < spawnRateModifier) {
try {
shoot();
increaseRate();
increaseHealth();
} catch (SlickException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.exit(0);
}
}
}