A
Aero88
Guest
Hi, I am a long time GM user, but haven't been very active on the forums since they were re-made which is why I have such a low post count.
I am making a platform game where the player can walk on the walls and the ceiling (or around a circle). Because the player can rotate, down is not always down (ie. 270 degrees)
I need to check directly under the players feet to see if there is a collision with a ground object regardless of the angle of the ground he is walking on. If it were a stranded platform game I would use something like this for the check.
But since my player can rotate (the direction of gravity can be anywhere from 0-360) I cannot just check the line directly below him all the time. I need to be able to rotate the coordinates of the collision line to check a line rotated to match the angle of the player.
The player mask is a rectangle (32x64) with the origin at (16,63) so I need to check a collision line directly below that rectangle regardless of its rotation about the origin.
Thank you in advance for your help! If I need to clarify anything please let me know. I can usually think my way through stuff like this, but I am getting a little stumped on this one.
I am making a platform game where the player can walk on the walls and the ceiling (or around a circle). Because the player can rotate, down is not always down (ie. 270 degrees)
I need to check directly under the players feet to see if there is a collision with a ground object regardless of the angle of the ground he is walking on. If it were a stranded platform game I would use something like this for the check.
Code:
if collision_line(bbox_left,y+1,bbox_right,y+1,objPar_Solid,true,true)
{
On_Ground = 1;
}
else
{
On_Ground = 0;
}
The player mask is a rectangle (32x64) with the origin at (16,63) so I need to check a collision line directly below that rectangle regardless of its rotation about the origin.
Thank you in advance for your help! If I need to clarify anything please let me know. I can usually think my way through stuff like this, but I am getting a little stumped on this one.