Null-Z
Member
For a part of my Adventure Guy game, the player must collect 4 objects before the main gate activates and opens.
I tried to approach this with a true/false system where I set global variables in the initialize room(Persistent)
I have a persistant object set to keep track of the variables when they change to true.
The collectible objects each change one of these variables to true when they touch the player object.
Then I have the gate object set to open when global.Unlock = true
only the Initialize room is persistent.
when I collect the 4 objects, the door does not open, what did I do wrong?
I tried to approach this with a true/false system where I set global variables in the initialize room(Persistent)
Code:
global.LockOne = false;
global.LockTwo = false;
global.LockThree = false;
global.LockFour = false;
global.Unlock = false;
Code:
if global.LockOne = true
{if global.LockTwo = true
{if global.LockThree = true
{if global.LockFour = true
{
global.Unlock = true;
}
}
}
}
Then I have the gate object set to open when global.Unlock = true
Create
Step
Code:
image_speed = 0;
Code:
if global.Unlock = true
{image_speed = 0.1}
if (image_index+image_speed >= image_number)
{
image_speed = 0;
}
if image_index = 7
{
if collision_rectangle(x+10,y-10,x-10,y-10,Player,true,false)
{
room_goto(RM_KnightHall);
}
}
when I collect the 4 objects, the door does not open, what did I do wrong?