This site requires JavaScript, please enable it in your browser!
Greenfoot back
Avik
Avik wrote ...

2013/5/19

HHHHHEEEEELLLLLPPPPP!!

Avik Avik

2013/5/19

#
import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot) /** * A simple balloon that can move up and down. * * @author Av */ public class balloon extends Actor { public void explode() { if(getOneIntersectingObject(point.class) != null) { getWorld().addObject(new Explosion(), getX(), getY()); getWorld().removeObject(this); } } public void act() { if (Greenfoot.isKeyDown("up") ) { setLocation (getX(), getY() - 2); } if (Greenfoot.isKeyDown("down") ) { setLocation (getX(), getY() + 2); Actor coin; coin = getOneObjectAtOffset(0,0, coin.class) ; if (coin != null) { World world; world = getWorld(); world.removeObject(coin); } } } }
Avik Avik

2013/5/19

#
this is my code for my balloon to explode. what is the code that I have to put in the explosion subclass.?
JetLennit JetLennit

2013/5/19

#
What do you need help with?
Avik Avik

2013/5/19

#
an exploding balloon. this is my code at the top. I think I need to put something in the explosion subclass. ehat do I put?
GreenGoo GreenGoo

2013/5/19

#
The best thing to do is to steal Mik's explosion in his Asteroid scenario. Making an animated explosion is a lot of hassle.
You need to login to post a reply.