Introduction
What this script will do is that first you press the right-button and then the left-button to get more score. You can't press the right-button twice in a row. Do you understand what I'm trying to say? I didn't know what to call it and since my main language isn't english I searched on a dictonary, hope it'll work with the title. Hopefully everyone will understand what it is after I showed the code :P
The Code
Since Foss isn't really a tutorial page as AS:Main I don't think I'll have to explain the code? Well, here it is:
_root.score=0;
onEnterFrame = function(){
if(Key.isDown(Key.LEFT)&&!Key.isDown(Key.R
IGHT)&&_root.turn>=1){
_root.score+=1;
_root.turn=0;
} else if (Key.isDown(Key.RIGHT)&&!Key.isDown(Key.LE
FT)&&_root.turn<=0){
_root.score+=1;
_root.turn=1;
}
};
To show score simply make a text box called "score" without quotes. More on making text boxes you can find here.
You can ofcourse change it as you like and have it in your game or whatever.
If anyone got a better code that does the same maybe you can post it here?
//guywithhiscomp
