K
kaito
Guest
So my question is how place_meeting would be in the form of a code
I came up with this
Let's imagine that we have two objects player and wall
And both have a square mask
if x-8 <= wall.x-8
{
if x+8 >= wall.x-8 if y-8 <= wall.y-8
{
if y+8 >= wall.y-8 collision = true
}
else if y-8 <= wall.y+8 collision = true
}
else if x-8 <= wall.x+8
{
if x+8 >= wall.x-8 if y-8 <= wall.y-8
{
if y+8 >= wall.y-8 collision = true
}
else if y-8 <= wall.y+8 collision = true
}
I know it's not perfect
So how place_metting in code form looks like for real?
I came up with this
Let's imagine that we have two objects player and wall
And both have a square mask
if x-8 <= wall.x-8
{
if x+8 >= wall.x-8 if y-8 <= wall.y-8
{
if y+8 >= wall.y-8 collision = true
}
else if y-8 <= wall.y+8 collision = true
}
else if x-8 <= wall.x+8
{
if x+8 >= wall.x-8 if y-8 <= wall.y-8
{
if y+8 >= wall.y-8 collision = true
}
else if y-8 <= wall.y+8 collision = true
}
I know it's not perfect
So how place_metting in code form looks like for real?