Hello,
I implemented a counter in my enemy class. It's supposed to respawn itself at intervals.
I have:
and the respawn is implented in addthis()
I have this in my class;
Any idea as to why this is not making the character spawn? I'm pretty sure it worked for my past worm game, so I'm confused as to why it's not working here.
public void act()
{
respawn --;
countdown --; //prevents character from getting stuck at the edge
move(movespeed);
check();
addthis();
}public void addthis()
{
if(respawn == 0)
{
getWorld().addObject(this, Greenfoot.getRandomNumber(540)+20, 287);
respawn = 10;
}
}private int respawn = 10;

