I need my character to acceletare before he reaches maximum speed, also I need him to stop at a wall but I still need a variable that i can call which tells me if he is touching the wall
public class Player extends Actor
{
/**
* Act - do whatever the Player wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if(Greenfoot.isKeyDown("a"))
{
setLocation(getX()-5, getY());
}
if(Greenfoot.isKeyDown("d"))
{
setLocation(getX()+5, getY());
}
}
}

