• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

help with collision_rectangle with rotate rectangle

Conbeef

Member
hello,

is there a way to check if a rotated rectangle has collided with a object(precise collision)?

collision_rectangle_rotated( x1, y1, x2, y2, x3, y3, x4, y4, obj, prec, notme ); //something like this
 

Conbeef

Member
I have an idea about using a bunch of collision_line to make out the rectangle collision. Is that a good way to go about it or nah?
 

obscene

Member
Most efficient way (well ... simplest efficient way) would be to make a rectangular object sprite, create an invisible object using that as a mask and then stretching it to the same size and angle and then check a collision based on that. You could probably work the whole thing into a single script.

Otherwise you are going to have to use a series of collision line functions and depending on the detail of accuracy you need that could be a lot of wasted resources.
 
Top