Hello,
This all works perfectly, but one thing. How do I count in ones now?
Thanks
OUTPUT OF LIFE LOSS
580
560
540
520
500
480
460
ect...
OUTPUT NEEDS TO BE
600
599
598
597
596
595
ect...'and ending with time left counter if there is no win'
SCREENSHOT OF COUNTDOWN
ActionScript
//Starts with 600 life points, counts from 30-0
//game will be more intricate and retotal scores, this is just a sketch
var EQUATION:int;
var TIME:int = 30;
var COUNTDOWN:Number = 600;
var COUNTUP:Number = 0;
var START:int = getTimer();
var DELTATIME:int;
var lucky:int;
var myTimer:Timer = new Timer(1000,30);
myTimer.addEventListener(TimerEvent.TIMER,someFunction);
myTimer.start();
function someFunction(event:TimerEvent) {
DELTATIME = (getTimer() - START)/1000;
//trace(DELTATIME);
//lucky = Math.floor(Math.random()*55);
//trace(lucky);
EQUATION = COUNTDOWN - (DELTATIME*COUNTDOWN/TIME) + COUNTUP;
var str:String = String (Math.abs (EQUATION));
//var sub:String = ("000000")+ str.substr(0, 4);
//tx.text = String (sub);
tx.text = String ("YOU HAVE ")+(EQUATION)+(" POINTS");
txt.text = String(Math.floor(30 - DELTATIME))+(" SECONDS LEFT");
trace(EQUATION);
if(lucky==16){
myTimer.stop();
var mtInter:uint = setInterval (blk, 222);
function blk():void {
txt.visible = !txt.visible;
tx.visible = !tx.visible;
txt.text = String("You're Lucky This Time");
tx.text = String("You Get 100 Life Points!");
}
}
if(EQUATION==0){
myTimer.stop();
var mtIntv:uint = setInterval (blink, 222);
function blink():void {
txt.visible = !txt.visible;
tx.visible = !tx.visible;
txt.text = String("Time's Up!");
tx.text = String("You're Dead!");
}
}
}
SCREENSHORT OF WIN