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.

DarkBASIC Professional Discussion / Sprite Rotation and Collision Detection Problems

Author
Message
Keith Coles
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location:
Posted: 3rd Jan 2003 12:01
Right heres my problem,

on a 2d sprite if you rotate it around 180 degrees it rotates around the top left axis (Not the middle as would be expected). When you do this the collision area doesn't move from the original plotted location. This means that if a sprite has been rotated the collision detection area is not where the sprite image is.

Anyone got any suggestions on a way around this as its driving me nuts.

Thanks in advance,

Keith
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Jan 2003 12:44
You can use 'offset sprite' to move the actual coordinate of the sprite to its centre. It will then rotate around that point.

Login to post a reply

Server time is: 2024-05-17 04:37:39
Your offset time is: 2024-05-17 04:37:39