I want to make the int variable to get a random number between 20 and 200 but its only doing 200 and i need it to make the heightshift change in the act section, here's the code if you can help me:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class FlappyWorld here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class FlappyWorld extends World
{
int counter = 0;
int heightShift = Greenfoot.getRandomNumber(200);
/**
* Constructor for objects of class FlappyWorld.
*
*/
public FlappyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1, false);
FlappyBird flappy = new FlappyBird();
addObject(flappy, 100, getHeight()/2);
}
public void act()
{
counter++;
if (counter == 100)
{
BottomPipe pippy = new BottomPipe();
GreenfootImage image = pippy.getImage();
addObject(pippy, getWidth(), getHeight()/2 + image.getHeight() - heightShift);
counter = 0;
}
}
}


