Guest User

Programming

a guest
May 11th, 2013
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public void moving()
  2. {
  3. if ( Greenfoot.isKeyDown("up") )
  4. {
  5. setLocation(0,3) ;
  6. }
  7. if ( Greenfoot.isKeyDown("down") )
  8. {
  9. setLocation(0,-3) ;
  10. }
  11. if ( Greenfoot.isKeyDown("left") )
  12. {
  13. setLocation(3,0) ;
  14. }
  15. if ( Greenfoot.isKeyDown("right") )
  16. {
  17. setLocation(-3,0) ;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment