If I'm not entirely mistaken, you're getting stuck in an infinite loop. I don't know how the rest of your code looks, but I suggest that you re-build it a little bit.

You already have the concept of a "main loop" down, but in the wrong place. When you start the game, you should trap yourself in that while() loop you've written. From within it, you should update and draw the ship as needed.

Fenris Wrote:If I'm not entirely mistaken, you're getting stuck in an infinite loop. I don't know how the rest of your code looks, but I suggest that you re-build it a little bit.

You already have the concept of a "main loop" down, but in the wrong place. When you start the game, you should trap yourself in that while() loop you've written. From within it, you should update and draw the ship as needed.