Actually I figured out the thing, it was aids
In World:In Platform:
public int getMoney()
{
return Money;
}
public void subMoney()
{
Money -=10;
}if (Greenfoot.mouseClicked(this) == true && deployed == false && ((MyWorld) getWorld()).getMoney() >= 10 )
{
getWorld().addObject(new Turret(), getX(), getY());
deployed = true;
((MyWorld) getWorld()).subMoney();
}

