LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Collition Box and rotation.

Root / Programming Questions / [.]

raimondzCreated:
Hi, I'm having problems with collitions... again. I made an sprite that act like the clock's hands. It rotate to the player position but the colition box remain on the same place as if the sprite wasn't rotated. Here is a pic: https://miiverse.nintendo.net/posts/AYMHAAACAAADVHkp2W_T9w Anyone have an idea how can I solve this problem?. By the way, the sprite in the pic is just one case. I'm doing a engine to instance bullet using data so it could have any shape or home point.

It's by design; SmileBASIC's native collision model does not support rotation. If you want rotation-aware collision you'll unfortunately have to code it yourself.

Ok. I have an algorithm in mind to detect if the home position of a sprite A overlap a pixel of the sprite at position B but I need to call SPCOL each time I do a rotation. I'm going to see if this work and post here my results.