Hi,
I want to make my warning actors appears based on booleans from my player class.
Player: (called player)
world (called house)
I have it wired that when i press t it changes dirt = 1 and dirty = true and when i press y dirt = 0 and dirty = false
but when i press y all the variables change and the "Passed through" is printed but the object is not removed...
help?
if (dirt == 0)
{
dirty = false;
}
else if (dirt == 1)
{
dirty = true;
}
player myPlayer = new player();
boolean existsDirty = false;
if (myPlayer.dirty)
{
if (!existsDirty)
{
addObject(new warningDirty() , 300, 200);
existsDirty = true;
}
}
if (!myPlayer.dirty & existsDirty)
{
existsDirty = false;
warningDirty myWarning = new warningDirty();
removeObject(myWarning);
System.out.println("Passed Through");
}
