Sign in to follow this  
password

Quick question

Recommended Posts

password    181
I have made a basic "move the ship in y and x directions program" and the picture that is supposed to be the ship leaves trails after itself. That have never happened before when I made other games and how can I do something about it?
[SOURCE]
void Player::show() {
    shipBox.x+=xVel;
    
    if (shipBox.x<0)
        shipBox.x-=xVel;
        
    shipBox.y+=yVel;
    
    if (shipBox.y<0 || shipBox.y + SHIP_HEIGHT >= SCREEN_HEIGHT)
        shipBox.y-=yVel;
     
    apply_surface(shipBox.x, shipBox.y, ship, screen);     
}
[/SOURCE]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this