PDA

View Full Version : [AS2] if statement help


QueenofBumblebees
04-25-2009, 12:35 PM
I'm working on this game. Basically the user is asked to search for 10 items, which will be scattered around on the screen. There are three screens; i.e. we created a background that was three times as long as the stage, with arrows on either side to move it to the left or right. We made the items to move around as well, according to the screen. The items will also have to be clickable, and a score of 1 point will be allocated if the user clicks on the right item, and one point will be deducted if he gets the wrong one. The game ends when the user gets all 10 items right. I've managed to make the items move around while retaining their clickability. Their coding goes something like
item1.onRelease = function(){
score = score+1;
this._alpha = 0;
item1.enabled = false;
}

Thing is, the scoring system seems a little bit out of whack. It goes like this:
if (score=10){
gotoAndStop(162);
} else {
gotoAndStop(163);
}
1. However, regardless of the score, I'm forever getting frame 162. ZOMG MIGRAINE. I KNO RITE?
2. I'm not sure what the items should ACTUALLY be. Currently they're buttons within movie clips, which seem to work fine except for the scoring thing.
Anyway, any help will be VERY MUCH appreciated. Thanks in advance.

kkbbcute
04-25-2009, 03:12 PM
Welcome to AS.org :), well, It should be
if (score == 10) {

}

With the dual = signs, not just one =

QueenofBumblebees
04-25-2009, 03:42 PM
Welcome to AS.org :), well, It should be
if (score == 10) {

}

With the dual = signs, not just one =

I shall now give a reply of astonishing noobness.
OOOOOOOOOOOOOOOOOOHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH.
Thanks soo much. ZOMG YOU ROCK. Marry me? =3
It's all good. 8D

kkbbcute
04-25-2009, 03:55 PM
ZOMG YOU ROCK. Marry me? =3No thanks to your marriage proposal, being only 14, I'm below the legal age to marry you. :p

Jokes aside, good luck with your project!

scarce
04-26-2009, 08:59 PM
No thanks to your marriage proposal, being only 14, I'm below the legal age to marry you. :p

Jokes aside, good luck with your project!

eh, that all depends on personal morality and your geographic locaton...in some countries, you should already be married :)