In a room, a woman can access other levels by going thru doorways. Unfortunetly, she can also walk thru the walls. I made the walls a class(Walls) and they are a physically diff Object.
/* * I want this to work only when her midpoint y = y + (getheight/2)
* In other words, only when bottom(feet)intersect Walls.
*/
public boolean canSee(Class clss)
{
Actor actor = getOneIntersectingObject( clss);
return actor != null;
}
//The keypress controls are here, so she can only move if she isn't climbing walls.
public void checkForWalls()
{
if(!canSee (Walls.class))
{ checkKeyPress();}
}
I will post the scenario with open code so you can see what I'm trying to do.
Thanks in advance for your guidance.