I'm working on a pacman game for school, and I need some help with movement:
Here's my movement for up, but need some help. When I move up, 'up' becomes true. How would I make it false after using it?
if(Greenfoot.isKeyDown("up") && down == false && left == false && right == false)    
            {    
                up = true;
                int x = getX();  
                int y = getY();  
                int ny = getY()-4;  
                setLocation(x,ny);
                if(rotation != 270)
                {
                    turn(270 - rotation);
                }
            }
   
   
             
          
        

