I have a method in my world that changes the speed of my actor depending on how many points I have, but I cant get it to work because I need to put the method in my actor first.
this is in my world:
if(Greenfoot.getRandomNumber(1000) < enemySpawnRate)
{
Enemy e = new Enemy();
e.setSpeed(enemySpeed);
addObject(e, Greenfoot.getRandomNumber(getWidth() - 20)+ 5, -30);
scoreboard.addScore(5);
}
and i need to put setSpeed in my actor. what should the setSpeed method look like?