Skip to main content
Participant
May 11, 2006
Answered

decreasing a score

Okay, I was working my way through the MX 2004 game development book, and then I had the opportunity to make a game to teach good foods from bad foods. So, I altered the whack a capsule game that was in the book pretty significantly, mostly using it as a jumping point.

My problem is this: I have some of the tubes containing healthier foods, and others containing less healthy foods. when the player clicks on the good foods, the score goes up just fine, but when the player clicks on the bad foods, the score for the bad foods doesn't increment, it adds it into the score for the good foods. It does this even though they're supposed to look at different variables. I have had three people looking at it with me, and they can't figure out what's wrong, either, though they have suggested several things.

This is the part of the code that is misbehaving (if you need the rest of it, or the fla, I can provide it):
This topic is closed to new replies. Start a new post to keep the conversation going.
jthereliable-ohDoY4Correct answer
Inspiring
May 11, 2006
Umm I think that
this == _level0.m0 || _level.m1 || _level.m4 || _level.m5 || _level.m6 || _level.m8

doesn't work... I think that means if this== _level0.m0 and if _level.m1 exists and if _level.m4 exists and etc.
I did a quick verify of this by typing in:
trace(0==1 || 0 || 0 || 0 || 0 || 0)
and it shows up to be false... but in your case 0 DOES = 0

I think your code should be:
this == _level0.m0 || this == _level.m1 || this == _level.m4 || this == _level.m5 || this == _level.m6 || this == _level.m8

Hope it works.

3 replies

igneos_dAuthor
Participant
May 11, 2006
Thank you very much. I can't beleive it was that simple. =_=;
Translate
jthereliable-ohDoY4Correct answer
Inspiring
May 11, 2006
Umm I think that
this == _level0.m0 || _level.m1 || _level.m4 || _level.m5 || _level.m6 || _level.m8

doesn't work... I think that means if this== _level0.m0 and if _level.m1 exists and if _level.m4 exists and etc.
I did a quick verify of this by typing in:
trace(0==1 || 0 || 0 || 0 || 0 || 0)
and it shows up to be false... but in your case 0 DOES = 0

I think your code should be:
this == _level0.m0 || this == _level.m1 || this == _level.m4 || this == _level.m5 || this == _level.m6 || this == _level.m8

Hope it works.
Translate
Participating Frequently
May 11, 2006
Never mind my earlier post. It is kind of late here. :-)
Translate