Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Rotating Sprites. problem center point of rotation

Author
Message
darbiter
15
Years of Service
User Offline
Joined: 27th Oct 2009
Location:
Posted: 3rd Nov 2009 11:57
Hi

I am making a quite simple game of spaceships (like Asteroids if you want).

I have a ship wich rotates and moves, but rotates from the top left corner, and not from center of the picture.
Player ship is sprite #3.

How can I change the center point of rotation to the center of the ship?
darbiter
15
Years of Service
User Offline
Joined: 27th Oct 2009
Location:
Posted: 3rd Nov 2009 23:57
I found a solution


Solution:

Setting the offset point of the sprite.

dbOffsetSprite (PLAYER_SHIP, (dbSpriteWidth ( PLAYER_SHIP ))/2, (dbSpriteHeight ( PLAYER_SHIP ))/2) ;

Login to post a reply

Server time is: 2024-11-20 11:46:07
Your offset time is: 2024-11-20 11:46:07