Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void moving()
- {
- if ( Greenfoot.isKeyDown("up") )
- {
- setLocation(0,3) ;
- }
- if ( Greenfoot.isKeyDown("down") )
- {
- setLocation(0,-3) ;
- }
- if ( Greenfoot.isKeyDown("left") )
- {
- setLocation(3,0) ;
- }
- if ( Greenfoot.isKeyDown("right") )
- {
- setLocation(-3,0) ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment