You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AM2Rogue/Export_Code/gml_Object_oA3LabDoor_Step_...

38 lines
599 B

if (distance_to_object(oCharacter) < 80)
active = 1
else
active = 0
if (state == 0)
{
if active
{
state = 1
with (myblock)
instance_destroy()
sfx_play(sndDoorOpen)
}
}
if (state == 1)
{
if (image_index < 8)
image_index += 0.5
else
state = 2
}
if (state == 2)
{
if (active == 0)
{
state = 3
myblock = instance_create((x - (facing == -1 * 16)), y, oSolid1x4)
sfx_play(sndDoorClose)
}
}
if (state == 3)
{
if (image_index > 0)
image_index -= 0.5
else
state = 0
}