View Full Version : game scoring in "a set"?
universecity1
01-28-2007, 08:40 PM
Hi I am new here this is my first post...I am making a game where every 10 points the player gets a meter goes up 1...think of "10 reps to every set"...
I have the score working (1 point each time) but the set only goes up for the first 10 points...Does anyone know a way to make the set (dynamic textbox) go up for EVERY 10 points added to score?
Code below. Thank you.
on (press) {
_root.score++;
if (_root.score +=10 ) {
trace("on10");
_root.set++;
} else {
trace ("not10");
}
}
Gabe. :confused: universecity1@verizon.net
neilmmm
01-28-2007, 09:22 PM
try
on (press) {
_root.score++;
if (_root.score ==10 ) {
trace("on10");
_root.set++;
} else {
trace ("not10");
}
}
universecity1
01-29-2007, 02:42 AM
Hi thanks for quick response. Still no go. I tried the following:
//if (_root.score ==3) {
//if (_root.score = x+=10) {
//if (_root.score +=10 ) {
all the same, only first 10. A friend suggested set up a "lastscore" variable but I'm not quite sure so any other suggestions would be much appreciated
Thanks.
neilmmm
01-29-2007, 04:51 PM
do you want the score to go back to 0 so that it can count up to 10 againon (press) {
on (press) {
_root.score++;
if (_root.score ==10 ) {
_root.score =0;
trace("on10");
_root.set++;
} else {
trace ("not10");
}
}
if you want score to keep going up and the set going up you want a dummyScore too
var dummyScore:Number=0;
on (press) {
on (press) {
dummyScore++;
_root.score++;
if (_root.dummyScore ==10 ) {
_root.dummyScore=0;
trace("on10");
_root.set++;
} else {
trace ("not10");
}
}
hope that helps
universecity1
01-30-2007, 06:44 PM
I wanted the score to keep going and the code lets me- THANK YOU!!!!
I'LL SEND YOU THE GAME FOR HELPING ME (when its done natch) email me
universecity1@verizon.net and anyone else that wants beta versions or would like to freelance flash/director code contact me. I have a few flash
games I already made www.universecity.com will have the info in a month or so. THANKS AGAIN actionscript community!:)
neilmmm
01-30-2007, 08:14 PM
glad I helped
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.