N
NoCodeMonkey
Guest
I'm trying to get a light to turn off when the player comes in collision with the light, presses the space bar, and the light turns off. This is the code i have but its still not working -_-
[obj_light]
CREATE
myLight = true;
pSpace = keyboard_check_pressed(vk_space);
STEP
if place_meeting(x,y,o_player) && (pSpace)
{
myLight = false;
}
if myLight = false
{
sprite_index = s_Light_out;
}
else if myLight = true
{
sprite_index = s_Light_on;
}
[obj_light]
CREATE
myLight = true;
pSpace = keyboard_check_pressed(vk_space);
STEP
if place_meeting(x,y,o_player) && (pSpace)
{
myLight = false;
}
if myLight = false
{
sprite_index = s_Light_out;
}
else if myLight = true
{
sprite_index = s_Light_on;
}