How can I do Speed up button what increase my character speed?
if (Greenfoot.mouseClicked("SpeedUp.class") { //soldier speed up... move(5); }
int speed = 0; public void act() { //this means this object -> the soldier you play if(Greenfoot.mouseClicked(this)) { move(speed); } //this is only an EXAMPLE: if(Greenfoot.isKeyDown("a")) { speed--; //whenever the speed should be lower or higher you. Only write speed++; or speed--; . } }