I'm getting a "cannot find symbol - method getBuildable()".
And in the class Terrain there is
I am really confused because I thought that I could use Actor.method() to call it...
If you don't understand what i want to do:
I am working on a strategy game and there are Grass and Water subclasses of Terrain.
I want that you can only build something on a Grass Object.
Thanks for your help :)
1 2 3 4 5 6 7 8 9 | MouseInfo mouse=Greenfoot.getMouseInfo(); if (mouse!= null ) { x=mouse.getX(); y=mouse.getY(); if (getOneObjectAtOffset(mouse.getX(),mouse.getY(),Terrain. class ).getBuildable()) this .setLocation(mouse.getX(),mouse.getY()); } |
1 2 3 4 | public boolean getBuildable() { return buildable; } |