Hi again.
So, is it possible to use an instance variable, defined in another class, to use it in an if-statement, in the second class?


1 2 3 4 | public void fd_special_spist() { ormeSpist; } |
1 2 3 4 5 6 | private int xyz; public int getXyz() { return xyz; } |
1 | A a = (A) getWorld().getObjects(A. class ).get( 0 ); |
1 | A a = (A) getOneIntersectingObject(A. class ); |
1 2 3 4 5 | if (a != null ) //only when it touches A for example { int zyx = a.getXyz(); //or whatever you want to do with it //... } |
1 2 3 4 5 6 7 8 | public void nd_missil() { Player_1 a = (Player_1) getWorld().getObjects(Player_1. class ).get( 0 ); if ( //I want it to continue if ormeSpist == 3) { getWorld().addObject ( new ND(), getX(), getY()); } } |
1 | if (a != null && a.ormeSpist == 3 ) |
1 | if (a.ormeSpist == 3 ) |
1 2 3 4 | public int getOrmeSpist() { return ormeSpist; } |
1 2 3 | if (a != null && a.getOrmeSpist() == 3 ) //or if (a.getOrmeSpist() == 3 ) |