Re: Image Not Appearing

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...
Lone_EverGreen_Ranger said...

Success. I was missing SDL_Flip(), which is why it was not showing up on the screen. However not I am having a problem with keeping the ship stay on the screen.

I think you meant to say

Lone_EverGreen_Ranger said...

However, now I am having a problem with keeping the ship stay on the screen.

I ran the code and see the problem. The ship goes down ... and then down ... and never comes back up, unless I hit the arrow keys to move it up.

I think your intent was to have it bounce all around the screen, but when it hit an edge then it'd go the opposite direction.

Your if statement is wrong, but I don't think a single if statement is enough to handle this behavior. You need a more complex state machine to keep track of direction and how close the ship is to the edges of the screen.

I see. I figured it would involve more complex steps. If anyone could give me a headstart, I'd greatly appericate it. I'm not tasking to write my game, just some help.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu