10-29-2008, 06:23 AM
|
#1
|
|
Registered User
Join Date: Sep 2008
Location: Florida
Posts: 9
|
Keeping Score
Hoy there, ActionScripterz. Yeah uh... I have this 3rd issue regarding score-keeping. You see, because my game's map is too large for a single frame, a new frame is obviously needed. First off, allow me to show you my scoring system. (sorry for the huge screenies :: Scroll down for more info if you plox)
SCREENSHOT 1 :: The Score on 4th to 19th Frame, Main Time line.

SCREENSHOT 2 :: Here's Link BEFORE loading NEW map (We are currently @ Frame 4). Score is Normal.

SCREENSHOT 3 :: Here's Link AFTER loading NEW map (Now we are @ Frame 5). All scores maxed out. D:<

So here's the score: It may not look it, but on the 3rd screenshot Link has already loaded the new map (it's a duplicate map, for testing purposes). HOWEVER~!!! After this new map loads, the score (RUPEES as well as other status points such as HEALTH & LIVES) completely max out. Now I'm no pro, I've spent several weeks on this subject alone. Could this be a difficult matter? How may I keep the scores from being affected by the map loads/frame change? Help appreciated! Helpers credited~!
If this post is too difficult to understand, let me know. Yus?
______________________________________________
My Recent AS Pros
mrownage (Cameron Gullotta) - [Enemies AI] (When Enemies detect)
x-death - [Enemy AI :: HP] (Enemies have a life too!)
Last edited by Mayhew; 10-29-2008 at 06:33 AM.
|
|
|
10-29-2008, 01:31 PM
|
#2
|
|
Senior Member
Join Date: Sep 2005
Location: NYC
Posts: 250
|
I think we need to see some code... hard to see what's causing that.
__________________
FreeActionScript.com- AS2 & AS3 Game Tutorials, Samples, Source Files & Downloads
|
|
|
10-29-2008, 02:47 PM
|
#3
|
|
Registered User
Join Date: Apr 2008
Posts: 173
|
Yup, no chance in finding the bug without code. Post your whole FLA if you want.
|
|
|
10-29-2008, 11:11 PM
|
#4
|
|
got as?
Join Date: May 2007
Posts: 628
|
i understand why he doesnt wana post his whole project online... on the level before that set a variable when he leaves for all of his items.. example
bobjoe = lives.text
or something like that... then on the next level on the onEnterFrame code enter this...
lives.text = bobjoe
that way its the same.. as it was when you left the last level
if that doesnt work you might need to show us some more code.
|
|
|
10-31-2008, 08:57 AM
|
#5
|
|
Registered User
Join Date: Sep 2008
Location: Florida
Posts: 9
|
Keeping Score During Frame Change.
Okay, I apologize that my last post didn't help you understand. And I can't put up my whole project, since there are way too many things in there I'm worried about other people taking. Anyway, My issue is this: Say, for example, the first frame in the main timeline has his code ready:
ActionScript Code:
score.text = 0;
health.text = 60;
lives.text = 3;
In the game, everything works fine until my character "Link" loads the second frame in the main timeline. All the points on that second frame then suddenly max out completely:
Score: 500 (max)
Health: 999 (max)
Lives: 3 (max)
---But they're not supposed to max out. They are supposed to continue scoring from where Frame 1 left off. D:
On the second frame, the code is the exact same thing:
ActionScript Code:
score.text = 0;
health.text = 60;
lives.text = 3;
OrangeGold, you mentioned a code that may have given me ideas. You mentioned OnClipEvent(enterFrame)? I'm assuming there is some necessary code to add in my character's movieclip, Oy? I'll attempt to work on it, but I would very much appreciate a little more assist. But thank you at least for taking the time to help me.
If this is still difficult to understand, please take this brief FLA file that demonstrates my very same issue: http://files.filefront.com/Keep+Teh+.../fileinfo.html Remember! In the fla file, when running the preview, collect the green pickups before heading into the blue bar ahead of you. After you've collected 7 points, go thru the blue bar to load the next frame of the main timeline. Your points will be maxed out just as I feared.
Last edited by Mayhew; 10-31-2008 at 10:05 AM.
|
|
|
10-31-2008, 12:26 PM
|
#6
|
|
Senior Member
Join Date: Sep 2005
Location: NYC
Posts: 250
|
The scrore doesn't actually max out. Trace it in your onEnterFrame and you'll see.
What happens is, you have copies of the text boxes on each frame. So, when you switch frames the value in those text boxes gets screwed up.
Place the score/health/whatever on its own layer. Give it only one keyframe on the first frame, and extend that layer to cover all the map keyframes.
__________________
FreeActionScript.com- AS2 & AS3 Game Tutorials, Samples, Source Files & Downloads
|
|
|
11-01-2008, 12:13 AM
|
#7
|
|
Registered User
Join Date: Sep 2008
Location: Florida
Posts: 9
|
Mkay, I just realized the onEnterFrame is something I haven't used before. So now we're getting somewhere. Thank you, Pradvan & Orange Gold.
This is what came up so far:
ActionScript Code:
onClipEvent (enterFrame) {
my_mc.onEnterFrame = function () {
trace ("onEnterFrame called");
}
Nothing's been done yet because I'm not quite familiar with its use yet. It looks like the code belongs in a movieclip. Okaaay~ So then, as Pradvan stated, I must give the score its own layer and its own frame.. then stretch/extend that frame so that it covers the map frames on the other layer. Like this?

As usual, the score.text goes in the score layer's extended frame, then the onEnterFrame goes in my character's movieclip on every frame in the Map Layer. I'll experiment with the onEnterFrame, but if you please, how would it be used in my case?
Last edited by Mayhew; 11-01-2008 at 12:39 AM.
Reason: Typos <3
|
|
|
11-03-2008, 01:42 PM
|
#8
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
[MODERATOR]
Please do not remove the thread when somebody else is helping... Thank you...
[/MODERATOR]
|
|
|
11-03-2008, 01:47 PM
|
#9
|
|
Senior Member
Join Date: Sep 2005
Location: NYC
Posts: 250
|
So that's what happened to the thread. So I'm assuming you fixed the issue with the game?
__________________
FreeActionScript.com- AS2 & AS3 Game Tutorials, Samples, Source Files & Downloads
|
|
|
11-03-2008, 01:50 PM
|
#10
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
The thread was removed, so I reinstated it...
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 07:20 PM.
///
|
|