ForumsProgramming Forumas3 score

4 4006
alsage
offline
alsage
132 posts
Nomad

I am wondering how I create a score? Pretty much all I need is like a counter...

  • 4 Replies
gone3d
offline
gone3d
17 posts
Nomad

It all depends on what you're scoring - a timer for time based score, a global var to keep track of the current score, etc. There are any number of ways to create one - you'll need to be more specific

D

alsage
offline
alsage
132 posts
Nomad

Like a time counter so it says how long you have lasted without dieing (by seconds)

gone3d
offline
gone3d
17 posts
Nomad

There are a ton of examples out on the web - but this is the basics you'll need - and instead of a trace, update the text field with the count and you'll have seconds

// Somewhere in the main function
var myTimer:Timer = new Timer(1000);
myTimer.addEventListener(TimerEvent.TIMER, updateTimer);
myTimer.start();

private function updateTimer(e:TimerEvent):void {

trace(e.target.currentCount);
}

alsage
offline
alsage
132 posts
Nomad

Thanks a lot!

Showing 1-4 of 4