William Garrison
Member
Why doesn't this work?
What I am trying to have happen is when the user presses 1 the frame changes to 0 and sets toggle to true. Then if they hit 1 again it switches back. Seems so simple. It's little things like this that really tear me down. What am I missing the logic on here? Its like the variable isnt ... variabling.
Code:
var toggle = false;
if keyboard_check_pressed(ord("1")) && (!toggle) {
image_index = 1;
toggle = true;
}
if keyboard_check_pressed(ord("1")) && (toggle) {
image_index = 0;
toggle = false;
// more here
}