Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void act()
- {
- if (Greenfoot.mouseClicked(null))
- {
- MouseInfo mouse = Greenfoot.getMouseInfo();
- int direction = Greenfoot.getRandomNumber(360);
- addObject (new Ball(direction), mouse.getX(), mouse.getY());
- }
- if (Greenfoot.getKey()==("space")){
- int direction = Greenfoot.getRandomNumber(360);
- addObject (new Ball(direction), 300, 250);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement