note player is a space ship.
in player class i have set up collision so that player cant go above window and below.
player class
public void playerWCollision()
{
if(y < 0)
{
y = 0;
}
else if(y+height > Main.WINDOW_HEIGHT)
{
y = Main.WINDOW_HEIGHT-height;
}
}
lets say player got hit so i want my player to fall down. by adding to x, y postion it will look like player is gong down.
public void hit()
{
x+=dx;
y+=dx;
}
problem is that i want player to keep going down. this doesnt happen bc of collision function above. is there way i can keep my collision function and some thing in hit methods? that my player will keep going down.