|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
[help]flash game and level up ?
ok i cannot figure this out ..
what i want is when the player get a certain ammount of points then it goes up a level .. this is whta i have Code:
onClipEvent (load) {
if (_root.score=30) {
_root.youwin_mc.gotoAndPlay(2);
}
}
but this doesnt work ..i cannot findout what should go here>>>>> score=30 thanks for any help cheers |
|
#2
|
||||
|
||||
|
I've attached an .fla and some code. This code goes in a keyframe instead of a clip.
Code:
_root.createTextField("score", 0, 0, 0, 0, 0);
score.type = "dynamic";
// ===========================================
this.onEnterFrame = function() {
if (score.text == 30) {
youwin_mc.gotoAndStop(2);
}
};
button.onRelease = function() {
score.text = score.text+30;
};
Last edited by jmichels : January 13th, 2004 at 05:03 PM. |
|
#3
|
|||
|
|||
|
this is how it worked for me ..
Code:
onClipEvent (enterFrame) {
if (_root.score == 30) {
_root.youwin_mc.gotoAndStop(2);
}
}
thanks so much for the help .. CHEERS ! ![]() ___________________________________ 1 more thing ..i cannot for the life of me dulicate a mc .. what i want is when they are shot they will randomly appear .. or to make it super easy .. just re appear in the same spot .. can you help on that as well .. shot =goto empty frame ..and wait x ammount of time ,,then appear again . setTimer() set interval ? i have been working on these 2 things for 30 hours .. cheers Last edited by timothye : January 13th, 2004 at 05:06 PM. |
|
#4
|
||||
|
||||
|
My pleasure.
![]() |
|
#5
|
||||
|
||||
|
You would have to script a hitTest and when it finds that the two clips have intersected, you would need this code for the keyframe:
Code:
timer = setInterval(delay, 2000);
function delay() {
clearInterval(timer);
i = i+1;
duplicateMovieClip(clip, "clip"+i, i);
}
In the movie clip's actions panel, you would need: Code:
onClipEvent (load) {
this._x = random(250);
this._y = random(150);
}
Last edited by jmichels : January 13th, 2004 at 06:45 PM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > [help]flash game and level up ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|