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

2016/6/14

HELP!!! cannot find symbol- class

Elexios Elexios

2016/6/14

#
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
trimil trimil

2016/6/14

#
Did you make a class called "Cactus"?
Elexios Elexios

2016/6/14

#
of course
trimil trimil

2016/6/14

#
Can I see the entire code of your class?
Elexios Elexios

2016/6/14

#
which class cactus or the one that that code is in?
trimil trimil

2016/6/14

#
not cactus
Elexios Elexios

2016/6/14

#
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); } } }
trimil trimil

2016/6/14

#
I tried this code and it worked for me, so I don't know what the problem is.
Elexios Elexios

2016/6/14

#
ok
Super_Hippo Super_Hippo

2016/6/14

#
You mixed up 'Cactus' and 'Catcus' as you may already noticed.
You need to login to post a reply.