Forum Topic: AS stuff

(131 views • 5 replies)

This topic is 1 page long.

<< < > >>
Questioning

DannyMac910

Reply To Post Reply & Quote

Posted at: 1/15/06 11:26 AM

DannyMac910 NEUTRAL LEVEL 05

Sign-Up: 01/08/06

Posts: 24

yo i made a game using a tutorial on NG, it got blamed, furthermore i was wondering if anyone knew how to put a timer in the game and a score box or any other action script i can use to help make my game better. thank for da help


None

Cybex

Reply To Post Reply & Quote

Posted at: 1/15/06 11:31 AM

Cybex NEUTRAL LEVEL 20

Sign-Up: 03/04/05

Posts: 7,744

At 1/15/06 11:26 AM, DannyMac910 wrote: yo i made a game using a tutorial on NG, it got blamed, furthermore i was wondering if anyone knew how to put a timer in the game and a score box or any other action script i can use to help make my game better. thank for da help

For score you could put

onClipEvent(load){
_root.score = 0
}

onClipEvent(enterFrame){
if(stuff happens){
_root.score++;
}

and then make a dynamic text box with the var name of score.


None

GuyWithHisComp

Reply To Post Reply & Quote

Posted at: 1/15/06 11:32 AM

GuyWithHisComp LIGHT LEVEL 24

Sign-Up: 11/10/05

Posts: 4,027

For the score box:
Make a text box
Open properties while the text box is highlighted
Write score in the Var box
Highlight your frame
Open up actions bar
Write this code:
var score:Number = 0;
Make a button
Highlight the button and open up actions bar
Write this code:
on(release){
_root.score ++;
}

BBS Signature

None

GuyWithHisComp

Reply To Post Reply & Quote

Posted at: 1/15/06 11:52 AM

GuyWithHisComp LIGHT LEVEL 24

Sign-Up: 11/10/05

Posts: 4,027

For the timer:
Make a dynamic text box, as stated above..
Var name it ubertimer
Highlight your frame.
Open actions bar.
Write this code:
stop();
var sec:Number = 10;
var min: Number = 1;
ubertimer = min + ':' + sec;
function ubernew(){
sec --;
ubertimer = min + ':' + sec;
if(sec < 1){
min < 1 and sec < 1 ? gotoAndStop(2) : 0
sec = 60
min --;
}
}
setInterval(ubernew,1000);

You can hange gotoAndStop(2) to whatever you want to happen...

BBS Signature

None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 1/15/06 11:56 AM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 9,716

Yay, Snail's back.

haXe AliceML Box2dLite Learn AS
#ngprogramming at irc.freenode.net
OVER NINE THOUSAAAAND!!!


None

DannyMac910

Reply To Post Reply & Quote

Posted at: 1/15/06 08:01 PM

DannyMac910 NEUTRAL LEVEL 05

Sign-Up: 01/08/06

Posts: 24

thanks guys


All times are Eastern Standard Time (GMT -5) | Current Time: 12:29 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!