J
Jdown79
Guest
Hey guys.
Building a platformer, and in my collision code its checking for a collision +1 with objWall.
I need it to check for two objects, and I figured the easiest way to do that was the OR statement.
But its disabled all collisions.
Is this not proper use?
Thanks all
Building a platformer, and in my collision code its checking for a collision +1 with objWall.
I need it to check for two objects, and I figured the easiest way to do that was the OR statement.
But its disabled all collisions.
Is this not proper use?
Code:
if (place_meeting(x,y+1,(objWall || objWedge)))
{
vsp = keyJump * -jumpSpeed
}
//Horizontal Collision
if (place_meeting(x+hsp,y,(objWall || objWedge)))
{
while(!place_meeting(x+sign(hsp),y,(objWall || objWedge)))
{
x += sign(hsp);
}
hsp = 0;
}
//Vertical Collision
if (place_meeting(x,y+vsp,(objWall || objWedge)))
{
while(!place_meeting(x,y+sign(vsp),(objWall || objWedge)))
{
y += sign(vsp);
}
vsp = 0;
}