Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public void act()
  2. {
  3. if (Greenfoot.mouseClicked(null))
  4. {
  5. MouseInfo mouse = Greenfoot.getMouseInfo();
  6.  
  7. int direction = Greenfoot.getRandomNumber(360);
  8. addObject (new Ball(direction), mouse.getX(), mouse.getY());
  9. }
  10. if (Greenfoot.getKey()==("space")){
  11. int direction = Greenfoot.getRandomNumber(360);
  12. addObject (new Ball(direction), 300, 250);
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement