im new to grenfoot
if (isTouching(Catcus.class))
{
getWorld().removeObject(this);
}
the part that is wrong is if (isTouching(Catcus.class))
it says cannot find symbol- class Cactus
import greenfoot.*;
/**
* Write a description of class blueBalloon here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class blueBalloon extends Actor
{
/**
* Act - do whatever the blueBalloon wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.isKeyDown("w"))
{
setLocation(getX(),getY()-1) ;
}
if (Greenfoot.isKeyDown("a"))
{
setLocation (getX()-1,getY()) ;
}
if (Greenfoot.isKeyDown("s"))
{
setLocation(getX(),getY()+1) ;
}
if (Greenfoot.isKeyDown("d"))
{
setLocation(getX()+1,getY()) ;
}
if (isTouching(Cactus.class))
{
getWorld().removeObject(this);
}
}
}