R
RealsLife
Guest
I've written code that works but for some reason I don't need to declare a variable I used but I need to declare another one that is used for somthing similar, let's watch some code.
create event:
wacht_tijd = 0;
step event:
///menu
scr_get_input();
//Selection & arrow movement
scr_direction_timers();
if(keyboard_check_pressed(up)||(UpTime > 10))
{
wacht_tijd += 1;
if(wacht_tijd > 4){selection -= up; wacht_tijd = 0;}
}
else
{
wacht_tijd = 0;
}
timer script:
/////////////////////////////////////////////////////////////scr_direction_timers();
//Sprite work on keys pushed
if(up){UpTime += 1;}else{UpTime = 0;}
if(left){LeftTime += 1;}else{LeftTime = 0;}
if(down){DownTime += 1;}else{DownTime = 0;}
if(right){RightTime += 1;}else{RightTime = 0;}
Why do I need to declare wacht_tijd = 0; but not UpTime =0;? I first did declare it because i'm used to C++ having trash in the variables so to have clean start but i'm still a noob overal so meeehhhh...
I hope you can help me folks <3
create event:
wacht_tijd = 0;
step event:
///menu
scr_get_input();
//Selection & arrow movement
scr_direction_timers();
if(keyboard_check_pressed(up)||(UpTime > 10))
{
wacht_tijd += 1;
if(wacht_tijd > 4){selection -= up; wacht_tijd = 0;}
}
else
{
wacht_tijd = 0;
}
timer script:
/////////////////////////////////////////////////////////////scr_direction_timers();
//Sprite work on keys pushed
if(up){UpTime += 1;}else{UpTime = 0;}
if(left){LeftTime += 1;}else{LeftTime = 0;}
if(down){DownTime += 1;}else{DownTime = 0;}
if(right){RightTime += 1;}else{RightTime = 0;}
Why do I need to declare wacht_tijd = 0; but not UpTime =0;? I first did declare it because i'm used to C++ having trash in the variables so to have clean start but i'm still a noob overal so meeehhhh...
I hope you can help me folks <3