I've been having a weird problem with my swing timer that I use in my game to count my points.
Here's the code:
The problem is that the thread does not run
NOTE: I found that if I started the timer BEFORE t, it works, why?
Here's the code:
The problem is that the thread does not run
Code:
public void start() {
if (!running) {
t = new Thread(this); // t is the game thread with the game loop
t.start();
countPoints.start(); // is the timer, that repeats itself, waits 80miliseconds then add points
running = true;
}
}