Hello
For my Labyrinth I created an actor called Flashlight. If the player cross this Item it should disappear. This is the code of my Player actor;
What I want is that the item gets removed (works fine) and then something happens (the Player can see further = not done yet)
When I run this application I get a "NullPointerException" error. The problem is the if statement....
How can I check if the Player crosses a flashlight? (there will be multiple flashlights)
Actor localFlashlight = getOneIntersectingObject(Flashlight.class);
if(intersects(localFlashlight)){
// do something
setLocation(400,100);
}
getWorld().removeObject(localFlashlight); //gefressenes Item entfernen
