F
filipe
Guest
Hi i have some code that checks to see if my player is touching a wall
i have two rooms with difference walls
and i need my code to check both walls The two walls are called obj_wall and obj_stone
how do i do that?
here is my code
if keyboard_check(vk_left)
{
if !place_meeting(x - 5, y, obj_wall) x -=3;
}
if keyboard_check(vk_right)
{
if !place_meeting(x + 5, y, obj_wall) x +=3;
}
if keyboard_check(vk_down)
{
if !place_meeting(x, y+5, obj_wall) y +=3;
}
if keyboard_check(vk_up)
{
if !place_meeting(x, y-5, obj_wall) y -=3;
}
i have two rooms with difference walls
and i need my code to check both walls The two walls are called obj_wall and obj_stone
how do i do that?
here is my code
if keyboard_check(vk_left)
{
if !place_meeting(x - 5, y, obj_wall) x -=3;
}
if keyboard_check(vk_right)
{
if !place_meeting(x + 5, y, obj_wall) x +=3;
}
if keyboard_check(vk_down)
{
if !place_meeting(x, y+5, obj_wall) y +=3;
}
if keyboard_check(vk_up)
{
if !place_meeting(x, y-5, obj_wall) y -=3;
}