|
The scoring variable of the space invaders is the var intScore:int = 0; on top of the code, where all variables are assigned. This variable gets increased in shotDown and shotDown2 functions where a collision between your shot and the alien has been detected.
Moving now to your treasure game, it's very easy to insert that variable increase below the lines you say "WAAAAHAYYYY, You found it".
Of course you must still define the variable on top of your program in a global position (I believe you know already about variable scope and when variables are visible only inside a function or not).
Happy coding!
|