Well basically I'm making a really simple game for a school project, and seeing as I know nothing about coding I'm keeping it nice and easy. I want the game to go into an animation after the viewer reaches a certain amount of points.
Basically all they have to do is click on some dumb orange and they get a whole 5 points, and a little text box goes up by 5 each time they accomplish this ridiculously easy task.
So what I want is for the viewer to be able to play the actual animation, when they accumulate, say, 50 points.
Any help is appreciated.
And yes, I'm serious.
You're making it in Flash?
on the button:
on(press){
if(score>50){
gotoAndPlay(wherever your animation starts)
}else{
score = score + 5
}
}that's presuming you have the movie paused while the clicking will be happening. Also make sure you define score as 0 in the main timeline (though you probably already did that)
the dynamic textbox would obviously be referred to as "score".
Quote from: Joey 2;1451701on the button:
on(press){
if(score>50){
gotoAndPlay(wherever your animation starts)
}else{
score = score + 5
}
}that's presuming you have the movie paused while the clicking will be happening. Also make sure you define score as 0 in the main timeline (though you probably already did that)
the dynamic textbox would obviously be referred to as "score".
Tried this, but it doesn't work when I try.
QuoteonClipEvent (load) {
this._x = random(550);
this._y = random(310)+90;
}
on(press) {
this.gotoAndPlay(4);
if(score>10){
gotoAndPlay ("2", 1);
}else{
_root.score +=5;
}
}
This is the code on my button.
This is the what's inside my button. On frame 1-3 there is a pulsating effect where the target grows and shrinks.
There is a "gotoAndPlay (1) ;" code on frame 3 to make it repeat this effect.
On frame 4-7 there is the target dissappearing, as if it had been shot.
Quote_root.duplicateMovieClip("target"+i,i,(_x=random(550),_y=random(310)+90));
gotoAndPlay(1)
This is the action on frame 8 in the button, so that it'll make another movie clip somewhere else when it's dissappeard, then it'll play frame one again, giving it the pulsating effect.
The movie is paused while the animation is happening, the score box is defined as 0 on the main timeline, it's var is score and it's dynamic.
The problem is that when the score gets to 50 it doesn't play Scene 2 frame 1, where my movie is, instead it continues to just give +5.
Thanks for the help, and thanks in advance for any more