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

2011/11/4

Getting <identifier> expected error

toro toro

2011/11/4

#
This is a part of the code: 1 Actor worm; 2 worm = getOneObjectAtOffset(0,0,Worm.class); 3 if (worm != null){ 4 getWorld().removeObject(worm); 5 } When I compile the source I keep getting an "<identifier> expected" error at row 2. I suppose its a simple problem, but I can't find the solution. What have I missed?
toro toro

2011/11/4

#
Ops. My bad. I found the error. I wrote the code outside the curly brackets of act()...
delmar delmar

2011/11/4

#
Good that you found it. One thing to keep in mind is that the error message is not always very precise or helpful - looking around the area of the error often shows what's wrong.
You need to login to post a reply.