Checking Instance Position Problem

B

buhalda

Guest
Instead of changing each individual wall, I made a code in the create event:

depth = -y;
image_speed = 0;

if instance_place(16,0,obj_wall_template) && instance_place(-16,0,obj_wall_template)
{
image_index = 0;
}

if instance_place(16,0,obj_wall_template) && instance_place(0,-16,obj_wall_template)
{
image_index = 1;
}
and so on...
Each wall is centered at 8,32 (size is 16x32) at the bottom. I want the code to check if there is a wall for example below 16 of it, and to the right 16 of it, and if those conditions are met, make the image changes so that its an L shaped wall instead of a straight one. But for some reason it doesn't do it. Not very sure which code to use, I've tried a few kinds, none worked. Help, am I using the wrong code? I'm bad at position checking...
cd2.PNG
 
B

buhalda

Guest
OK it works but with place_meeting instead, also I thought it was relative, apparently you have to put x+ before it
 
Last edited by a moderator:
Top