Well I did not see this one until now. When the player is able to find a key and open a door, for example, objLockedDoor2. Now this is where the problems come in, when I am re-entering the same room, the doors reappear in the same spot.
I had this code up and modified a while back on yoyogames and decided to use it, it is good but the only prob is the
(For anyone that needs this code you can use it, when it has been resolved)
objLockedDoor2 -- Persistent
Create
r=room
got=0
if room!=r{
visible=0
mask_index=sprInvis
}
else if room=r && !undoor2{
visible=1
mask_index=sprite_index
}
draw_y=0
if undoor2{
instance_destroy()
}
image_speed=0
draw_y=-4
Alarm[0]
visible=0
solid=false
mask_index=sprInvis
instance_destroy()
Step
if room!=r && visible{
}
else if room=r && !undoor2 && !visible{
visible=1
mask_index=sprite_index
}
// part 2
if place_meeting(x,y+6,objLink){
if global.keys>=1 && solid{
sound_play(Open)
sound_play(Item)
solid=0
global.keys-=1
undoor2=1
sprite_index=sprAppear
image_speed=0.3
alarm[0]=15
}
}
if sprite_index=sprAppear{
if draw_y>-8{
draw_y-=1
}
}
Draw
draw_sprite(sprite_index,image_index,x,y)
if sprite_index=sprSmoke2{
draw_sprite(sprKey,-18,x,y+draw_y)
}
Room_Start
if room!=r{
visible=0
mask_index=sprInvis
}
else if room=r && !undoor2{
visible=1
mask_index=sprite_index
}
My aim: Trying to have a door object, that stays open, also I do not need to make more of the same object to place in each room I have, let alone the only room I am currently using to add/fix objects.