I am creating a shooting game which involves a spaceship (the shooter) and asteroids (the target). I managed to display the spaceship the way I want and I am also able to move it on the screen using the keyboard the way I want. However, I am having problems loading the asteroids. I am using a timer to do the animation. Here's what I am trying to do with the asteroids: I want there to be 4 asteroids coming down the screen (from top to bottom). When one of the asteroids has reached the end of the screen, 4 more asteroids come down (at random positions on the screen). I have one timer object which calls the paintComponent() method every 25 milliseconds. Although this works fine for the movement of the spaceship and the firing of the bullets, it's way too fast for the asteroids (meaning the asteroids come down so fast). So, I was wondering whether it would be possible for the bullet animation to occur at a different speed then the asteroid animation (i.e. for the asteroids, I don't want the timer to call the paintComponent() method every 25 ms).
Thank-You in advance.
I know nothing about games, so hopefully a game pro will come around to help, but I would think that you could give each moving object a speed, perhaps an x and and a y speed, and using the system clock and these speeds, move only a certain distance for each slice of time.