In one of my classes I have the following code:
Error in line 18:
class, interface or enum expected
I have something similar in my world( without the getWorld() ) and it works perfectly.
I dont see my mistake...
I, in the end, just want to be able to write one(x,y) in my act method.
Thx
PStigerID
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class path17a extends Turtle { public void act() { Actor um = getOneIntersectingObject(umL8.class); if(um != null) { getWorld().removeObjects(getWorld().getObjects(path7intheway.class)); getWorld().removeObject(this); } } } private void one(int x, int y) { getWorld().addObject(new erL8(), x+116 , y+-36 ); getWorld().addObject(new erL8(), x+116 , y+-86 ); getWorld().addObject(new erL8(), x+116 , y+13 ); getWorld().addObject(new erL8(), x+116 , y+63 ); getWorld().addObject(new erL8(), x+116 , y+86 ); getWorld().addObject(new erL8(), x+52 , y+-36 ); getWorld().addObject(new erL8(), x+52 , y+-86 ); getWorld().addObject(new erL8(), x+52 , y+13 ); getWorld().addObject(new erL8(), x+52 , y+63 ); getWorld().addObject(new erL8(), x+52 , y+86 ); }