Problem with rotating

Hello everybody!
I have some problems with my game. I was sitting by this problem for long time and I still have nothing. I don't know how to solve a moving my spaceship problem. What I want to do? So, I want to move my spaceship in each possible direction and moreover have a possibility to rotate it in this same time. While holding press_up/press_down button I also want to use right/left button to rotate. I don't know is it clear. I hope that there will be a person who can help me : ).

I attached my code + one bitmap.

Arthur Kalliokoski

Nobody has answered in so long, and I had some time to kill (took me an hour!) so I rewrote it from scratch with some differences based on my rewrites of some of the examples.

I changed your bitmap to a TARGA tga file to provide transparency.

Both the source and tga file are in the paperclip.

If you wanted the ship to start and stop more smoothly, say so, it'd take me a few more minutes.

Also, it looks rather crappy without blending and such enabled, but it's complicated enough now.


Whoopsy! A fierce bug bars the way! Line 123 should be

  ship_angle += ALLEGRO_PI*2.0;



Thanks a lot for answering. You did exactly what I was looking for. I understood your code and it was good way to know something new. It nice of you that you wasted your time to help me sort out a problem. Currently version is fine to me and enough smoothly.

Thanks, once more!

Thread #613498. Printed from