phore_eyes
427 posts
|
i want to make it so that once you get to a certan frame your score goes up i have absolutly no idea how to even set up any type of score can anyone help me???
|
phore_eyes
427 posts
|
also i need to make it so if you go there again it dosn’t count
|
Janck
253 posts
|
You use a combination of variables and problem solving skills.
You might want to look up an actionscript tutorial.
|
phore_eyes
427 posts
|
to you know any places to look???
|
JudeMaverick
8844 posts
|
First, initalize the score variable by:
score=0;
And then, an event must happen to add 1 to a score so:
onClipEvent(enterFrame) {
//blablabla, Greg isn't awesome, face it.
score++
}
If you want to add a number like 5, change it to: score+=5.
Before Indie starts to shout at me, I’m lazy to use AS 2.0 :P
|
phore_eyes
427 posts
|
sweet thanks
but how would i get it to show the score smoewere
|
Nyde
25 posts
|
One way of displaying dynamic information is by creating a Dynamic Text box using the Text tool:
1) Pick the *Text Tool* from your Tools panel
2) Draw a textbox in your stage using the *Text Tool*
3) Format the text to whatever you want (font style, size, color, etc)
3) Select your textbox --> and then in the Properties panel, select *Dynamic Text* in that drop-down
4) In the *Var* field of the Properties panel, type the variable name you want to display (in our case, the variable name is score).
to test if it works place this code in the first frame of your timeline:
-----------
bq. score = 12; //this assigns 12 to score and if you did it right, your text box should display 12.
-----------
Let me know if that works out for you.
|
phore_eyes
427 posts
|
no it didn’t work thanks anyway
|
phore_eyes
427 posts
|
sweet i found it out you have to add root_score
in the text variable box
|
JudeMaverick
8844 posts
|
If it works, it should say 0 or the number you inputted. If you added a string, the same rules apply.
|