i'm trying call static method getpod
in class droppod
class droppod.getpod()
except need parameter droppod.getpod()
. how change getpod
method can access other class?
i know make land() static, don't want that. i'd try learn way.
public class droppod { protected static boolean opened; int pos = random.normalintrange(1777, 1794); public static void getpod(droppod drop) { drop.land(); } public void land() { level.set(pos, terrain.droppod_closed); game.updatemap(pos); opened = false; dungeon.observe(); } }
option 1: can create new instance of droppod in other class. instance, can call object.getpod().
option 2: mentioned this, make land static method , droppod.getpod() should work.
Comments
Post a Comment