Hello Everyone,
My group and I have still been continuing our work on Sociapoly (a version of Monopoly,) but we came across a small problem. Each time one of the four player pieces lands on a spot on the board, the game spawns the title deed. When a player does not "purchase" a title deed during his/her turn, the title deed is not removed. This causes a few complications, and so we are looking for a way to remove the unpurchased title deed. I will post the code below and attach a link to the current version of Sociapoly.
Any help will be very much appreciated, thank you for your time.
Our scenario
public class TitleDeeds extends Actor
{
/**
* Act - do whatever the PropertyDeeds wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
public void purchased()
{
if(getX() != 832)
{
if(Purchase.bought == true)
{
if(Chrome.turn == true)
{
setLocation(832,117);
}
if(Safari.turn == true)
{
setLocation(832,268);
}
if(Explorer.turn == true)
{
setLocation(832,418);
}
if(Firefox.turn == true)
{
setLocation(832,571);
}
}
}
Actor old = getOneIntersectingObject(null);
if(old != null)
{
getWorld().removeObject(old);
}
}
}
