hello, i'm beginner on greenfoot .
i want to make my actor move upwards/downwards just one cell, but how ?
note : there's only 2 path for my actor to move upwards/downwards
please help :')
public space(){
this.addObject(new Controller(), 600, 80);
}public class Controller extends Actor
{
private int stepCounter;
private nyan s;
public Controller()
{
GreenfootImage gfi = this.getImage();
gfi.clear();
this.setImage(gfi);
stepCounter = 0;
}
public void act()
{
stepCounter = Greenfoot.getRandomNumber(100);
World w = this.getWorld();
if ((stepCounter % 50 == 0)== true)
{
w.addObject(new koin(), 610, 55);
}
if ((stepCounter % 82 == 0)== true)
{
w.addObject(new koin(), 610, 155);
}
if ((stepCounter % 101 == 0)== true)
{
w.addObject(new koin(), 610, 255);
}
if ((stepCounter % 201 == 0)== true)
{
w.addObject(new koin(), 610, 355);
}
if ((stepCounter % 51 == 0) == true)
{
w.addObject(new meteor(), 610, 55);
}
if ((stepCounter % 70 == 0) == true)
{
w.addObject(new meteor(), 610, 155);
}
if ((stepCounter % 102 == 0) == true)
{
w.addObject(new meteor(), 610, 255);
}
if ((stepCounter % 200 == 0) == true)
{
w.addObject(new meteor(), 610, 355);
}
}
}if (stepCounter == 200)