Rotate a sprite without rotating its collision mask

TheOnlyWRT

Member
Hello!

So I am working on a platformer where the player can roll. I have been coding the rolling motion by moving at a certain speed over a given distance and rotating the sprite using image_angle. However, with gravity, the player gets stuck in the floor. I realized that this is because using image_angle rotates the collision mask.

The question I have is how do I get the player to rotate while rotating the collision mask without him getting stuck in the floor? If that is difficult, how do I rotate the sprite without rotating the collision mask?

Thank you!
 

kburkhart84

Firehammer Games
It is better for collision masks to be either circles or rectangles. It may also be better to actually properly animate the rolling instead of just changing the image_angle. But first, if you are using precise collisions, stop.
 

HayManMarc

Member
Draw the sprite in the draw event at the angle you want, but don't change the image_angle. Use a new variable for the draw event and change it.

rotation_angle = 0;

Draw event
draw_sprite_ext(x, y, blah , blah, rotation_angle, etc, etc);

Hope you get my terrible explanation. :/
 

Evanski

Raccoon Lord
Forum Staff
Moderator
You can set the collision mask as another sprite and the sprite index (the one to be drawn) as different sprites
 
Top