Ok I really shouldn't have left it this late but my assignment is due in like 3 hours and I have this problem which I have just tried everything with. I am making a space-invaders remake and one added feature is a repair tool that when activated repairs all barriers. Here is the Player class code with the Repair function.
public void Repair()
{
Actor Repair_Indicator = new Repair_Indicator();
if (gotRepair == true && Greenfoot.isKeyDown ("up"))
{
gotRepair = false;
getWorld().removeObject(repair_indicator);
Barrier.GetRepaired();
}
This code calls a function in the Barrier class, here is the code for that:
public static void GetRepaired()
{
int health = 10;
}
The health variable is declared at the top of the barrier class and initialized at 10, when bullets hit the barriers the health goes down, and this function should put it back up to 10, but I activate the repair tool and nothing happens, could someone help me out please?