Continuing with the Maze Game in Flash: Beat the Clock!

We’re going to add a simple timer to our maze game that we’ve been working on. (If you’ve missed a few sessions, start here.)

We want the timer to start at 1000 and count down to the player’s imminent doom.

To set up the initial value for the timer, let’s create a variable called scarytimer.var scarytimer:Number=1000;

Put that code at the very top, outside of any functions. If a variable is defined in a function, other functions will see it as undefined. So, at the top of the AcionScript, type in:var scarytimer:Number=1000;
right above where you seevar tiles:Object = new Object({width:52, height:26});