flyinian
Member
I've been following this YouTube tutorial for collision masking and so far so good. The video is time stamped when the collision code is complete for visual representation.
However, I'd like to make vehicles with collision but, noticed that the current collision system doesn't work with rotating collision masking that aren't even on all sides. It works great with squares but not rectangles.
What would I need to do to make the collision system work with rectangles?
The collision mask will remain in the horizontal position while the sprite rotates freely. Making the ends that aren't covered by the collision mask not be affected by Collision.
// The code from the video. Works well with square collision masking and square/smaller than collision mask sprites.
// Create
// Step
// Draw
Thanks for the help.
post POST:
After posting this and a bit of brain storming. I may create a different collision system for rectangles. I haven't given it a long look but, this tutorial may do good.
Feel free to reply to the op.
However, I'd like to make vehicles with collision but, noticed that the current collision system doesn't work with rotating collision masking that aren't even on all sides. It works great with squares but not rectangles.
What would I need to do to make the collision system work with rectangles?
The collision mask will remain in the horizontal position while the sprite rotates freely. Making the ends that aren't covered by the collision mask not be affected by Collision.
// The code from the video. Works well with square collision masking and square/smaller than collision mask sprites.
// Create
GML:
_Image_Angle = 0;
GML:
direction = point_direction(x,y,mouse_x,mouse_y);
_Image_Angle = direction;
GML:
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,_Image_Angle,c_white,image_alpha);
Thanks for the help.
post POST:
After posting this and a bit of brain storming. I may create a different collision system for rectangles. I haven't given it a long look but, this tutorial may do good.
Feel free to reply to the op.
Last edited: