So I want my actor to move the amount I have specified when i press the key, but I only want the code to run once even if i'm holding down the button. I imagine that I need a variation of (isKeyDown) but haven't been able to find anything.
if (Greenfoot.isKeyDown("up")) { setLocation(getX(), getY() + -5); }