Here is my code
double dy = 0; //is the value that is always being added
//to our Y coord in setlocation
double g = 0.5;//this is what is going to get ADDED
public void act()
{
setLocation( getX(), (int) (getY() + dy) ); // hint in here as to how to get gravity working with the g and dy
}
public void flapFlap()
{
if (Greenfoot.getKey() == ("space"))
{
dy = -4;
//when the space key is pressed flappys dy (gravity) is set to -4. when the g is less than 0 flappy goes up
}
else
{
dy = dy + g;
//whenever the space key is not being pressed increase gravity by 0.5. when the g is greater than 0 flappy goes down
}
}
