import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class GoodCastle here.
*
* @author (BradH)
* @version (a version number or a date)
*/
public class GoodCastle extends GoodTroops
{//time goes by as you gain money
private int moremoney = 100;
//assign counter
private Counter counter;
public GoodCastle(Counter pointCounter)
{
counter = pointCounter;
}
/**
* Act - do whatever the GoodCastle wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
//as time goes by points will be added
moremoney -- ;
if(moremoney == 0)
{
Counter.add(5);
}
}
}
This is my GoodCastle class I have a counter in my game and i want the counter to gain 5 points everytime "100;" goes by, but the error reads as follows non-static method add(int) cannot be referenced from a static context. So I think I need a new method to tell some sort of time so the counter.add(5) will not come up with this error.

