• Advertisement
Sign in to follow this  

Quick question

This topic is 4320 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
Sign in to follow this  

  • Advertisement