Hello!
I'm trying to create an "if" statement that uses multiple "getOneIntersectingObjectAtOffset" booleans. It looks like this:
(the "canSee" method contains this:)
This code compiles fine, but if all the objects listed in the above statement are touching the acting object, nothing happens. However, if I change the code to only ONE "canSee" method
the acting object will register that "PercyLSpencer" is touching it. Any suggestions?
if (canSee(PercyLSpencer.class)&& canSee(Raytheon.class) && canSee(ChocolateBar.class)) { getWorld().addObject(new Microwave(),350,350); }
public boolean canSee(Class clss) { Actor actor = getOneObjectAtOffset(0, 0, clss); return actor != null; }
if (canSee(PercyLSpencer.class)) { getWorld().addObject(new Microwave(),350,350); }