I have a game with one rocket, 3 asteroids, one planet, and two counters. One counter records the collisions between the rocket and asteroids. How do I keep this counter separate from the other with only one counter and instructions class?
public class MyWorld extends World
{
Counter scoreCounter = new Counter();
Counter collisionCounter = new Counter();
...
public MyWorld()
{
super(600, 400, 1);
addObject(scoreCounter, 100, 25);
addObjject(collisionCounter, 100, 50);
...
}
...
public Counter getCollisionCounter()
{
return collisionCounter;
}
public Counter getScoreCounter()
{
return scoreCounter;
}
}