From the menubar, select 'Edit>Import class...' , select the 'Counter' class and click the 'Import' button. Then create two instances of the Counter class and pass one to each player, when creating them, to hold and use.
What do you have for creating the players and the counters in your world class?
What do you have in the Player classes as far as the counters are concerned?
Its okay everything is fine but I want to know how to carry on the counter every level rather then loosing the current score then making a new counter next level.
It works but every level it gets created a new one but looses the current score. How do I make it carry on the counter rather then making one every level.
Alright. What are you doing with the 'score' value that is being passed to the Level2 constructor? (in your Level2 class code, show section that starts 'public Level2(int score)' ).
public Level2(ScoreManager score) {
super(new LevelInfo(
10, // Total enemies
3, // Enemy max health
6, // Enemy speed
100, // Enemy value
Color.GREEN // Background color
), score);
}