There's no tutorial for those unfortunately. The best I could do now is to give you example from
Cherry On Top, a game I've made some time ago for Food Jam
Cherro (the hero of the game) has this in his text:
Code:
anim attack1
@script
if(frame==1){
void self = getlocalvar("self");
int Shoot = getglobalvar("Rashut");
if(Shoot != 583){
setidle(self, openborconstant("ANI_IDLE"));
}
}
@end_script
delay 1
offset 20 56
bbox 3 16 34 41
frame data/chars/cherro/idle.png
delay 10
@cmd keyint "ANI_FOLLOW1" 0 "U" 0
@cmd keyint "ANI_FOLLOW2" 0 "D" 0
@cmd keyflip
frame data/chars/cherro/shoot1.png
sound data/sounds/shoot.wav
@cmd shooterW "Biji" 23 30 2 0
frame data/chars/cherro/shoot2.png
delay 20
frame data/chars/cherro/idle.png
The script cancels his attack if global variable "Rashut" isn't set with proper value. To set that variable, he must take certain powerup. In other words, he must take shoot powerup to allow him to shoot
That's one way to set global variable. There are many ways to do it