Greenfoot Counter Flashcards
1
Q
How do you add counter to world?
A
theCounter = new Counter(); addObject(theCounter, x, y);
2
Q
How do you create reference to counter?
A
private Counter theCounter;
3
Q
How do you create the method getCounter?
A
public Counter getCounter()
{
return theCounter;
}
4
Q
How do you do counter tingy in object tingy?
A
Space world = (Space) getWorld();
Counter counter = world.getCounter();
counter.add(1);