I am very new to coding and Greenfoot, so go easy on me. For part of my assignment, I need to have my enemy's speed increase over time, however, I'm not sure how you do this, and everything I try just breaks the game, here is the base code that makes the enemy move, if you can figure out how to increase the enemy's speed by 1 every 15 seconds or so, that would be greatly appreciated
public class Enemy extends Actor
{
int X_MOVE = 3;
int Y_MOVE = 3;
public void act()
{
setLocation(getX() + X_MOVE, getY() + Y_MOVE);
if ((getX() > 580) || (getX() < 20))
{
X_MOVE = X_MOVE * -1;
}
else if ((getY() > 380) || (getY() < 20))
{
Y_MOVE = Y_MOVE * -1;
}
}
}
