The purpose of my game is to appear a few questions when the main actor, Alien encounters foreign planets.
So, whenever he touches a planet, a question will appear. I've created the Alien class, the Menu class (which is where the questions are displayed) and another classes which represent the planets. I tried to create the relationship between Alien and Menu classes, but it doesn't work.
// in Alien class
public Actor planet_x;
planet_x = getOneIntersectingObject(Alien.class);
if (planet_x != null)
{
getWorld().addObject(new Menu(planet_x), 250, 250);
}
// in Menu class
public Menu(Actor planet)
{
if (planet_x == Mars.class)
// display question 1
if (planet_x == Pluto.class)
// display question 2
...
}


