import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot)
/**
* A simple balloon that can move up and down.
*
* @author Avik
*/
public class balloon extends Actor
{
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);
}
}
} public void explode()
{
if(getX()==4X && getY()==4Y)
{
getWorld().addObject(new Explosion(), getX(), getY());
getWorld().removeObject(this);
}
}
}
WHATS WRONG WITH THIS?
What is the aim? What do I change the aim to?