P
Paymon005
Guest
To exemplify, I have written the code below with an object and placed it within a room.
Create:
state = 0;
Step:
if (state == 0){
if(keyboard_check_pressed(vk_enter)){
state = 1;
if(state == 1){
if(keyboard_check_pressed(vk_enter)){
state = 2;
}
}
}
}
Draw:
if(state == 2){
draw_text(room_width/2,room_height/2,"HELLO WORLD")
}
You should have to press ENTER twice in order for hello world to appear on screen, however one press changes state to 2. If i place a breakpoint within the first if layer and debug, this does not occur. Thanks for any help.
Create:
state = 0;
Step:
if (state == 0){
if(keyboard_check_pressed(vk_enter)){
state = 1;
if(state == 1){
if(keyboard_check_pressed(vk_enter)){
state = 2;
}
}
}
}
Draw:
if(state == 2){
draw_text(room_width/2,room_height/2,"HELLO WORLD")
}
You should have to press ENTER twice in order for hello world to appear on screen, however one press changes state to 2. If i place a breakpoint within the first if layer and debug, this does not occur. Thanks for any help.