I have a timer for an asteroid in the world, once the timer is done, the game starts and the asteroid starts to move, and when it touches the edge, it wraps. I've made it so every single time the asteroid wraps, a new asteroid is added into the world. This will force the player to destroy them instead of dodging them once I add a shooting functionality. However, once a new asteroid is added into the world, the new asteroid has to go through the timer again until it could move.
How would I make the new asteroids being added into the world, not have to go through this same timer?
Here is my asteroid code:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Asteroid here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Asteroid extends EnemyObjects
{
private int time = 500;
private int time2 = 2350;
int speed = 5;
public Asteroid()
{
GreenfootImage myImg = getImage();
myImg.scale(myImg.getWidth()/15, myImg.getHeight()/15);
setImage(myImg);
}
public void asteroidMovement()
{
time--;
if(time <= 0)
{
move(-speed);
}
}
public void wrapAtEdge()
{
time2--;
if(time2 > 0 && getX() < 0)
{
setLocation(getWorld().getWidth(),Greenfoot.getRandomNumber(600));
Asteroid newAsteroid = new Asteroid();
getWorld().addObject(newAsteroid, getWorld().getWidth(),Greenfoot.getRandomNumber(600));
}
}
public void act()
{
asteroidMovement();
wrapAtEdge();
}
}

