hi, i'm creating a simple game in the same style as the huge dungeon tutorial. anyway, i'm trying to get to get the doors working and i got them working somewhat but they are still being very glitchy, by glitchy i mean, for example, they seem to open and close depending on how close you are to them. heres the code:
if state_value=0
if last_block$="#"
show object 40000+Block_id
position object 40000+Block_id,z*cube_size,0,x*cube_size
else
show object 40000+Block_id
rotate object 40000+Block_id,0,90,0
position object 40000+Block_id,z*cube_size,0,x*cube_size
endif
else
if last_block$="#"
show object 40000+Block_id
rotate object 40000+Block_id,0,90,0
position object 40000+Block_id,(z*cube_size)+(cube_size/2.3),0,x*cube_size
else
show object 40000+Block_id
rotate object 40000+Block_id,0,180,0
position object 40000+Block_id,z*cube_size,0,(x*cube_size)+(cube_size/2.3)
endif
endif
state_value tells it to be open or closed, 1 for open, 0 for closed
last_block was the block that was last block to have its block type and location calculated, "#" means a wall