|
-
-
Does anyone have any idea to do this! Please help
-
Senior Member
You could perhaps explain it more. Do you have text field inside health bar movie clip and you want to show some numbers there or do you want to add points to global score every time health is reduced?
-
I don't really care how it's done as long I can keep a score that will transfer from frame to frame without resetting. I don't have a text field inside of the healthbar, i think a global score would be the best (just a guess ).
By the way, What is global? i have a hunch but i am not sure. Is it something that lasts throughout all the frames?
Sorry. i am kind of new
-
Intermediate Game Dev
^Yep.Global == everywhere accessible variable.
If you want to keep the score through all frames, you could do somthing like this: (All written in the main timeline)
PHP Code:
_root.scoreTXT = 0; //Sets the score variable to 0.
Now, if you have written some code in the hero's movie clip, then you can do somthing like this:
PHP Code:
onClipEvent(enterFrame) {
if (_root.enemy.hitTest(this._X, this._y, true) == true) {
_root.score += 5; //Adds 5 to the score variable
}
}
That is basically how you can access the variable.
Hope that helps, and if unclear, just post it.
Needs an update... 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|