Search tutorials
Note: If you are reading this, you probably should have read my other tutorial, making a cool multi-level game. OK, first thing's first. Open a new Flash document and create a movie clip called character and draw a person on a scooter.(Don't put the clip on the stage, though.) Then, make another movie clip(not on the stage) and call it energy. Draw a red rectangle. Then make a movie clip called ready and make an animation saying "READY, SET, GO!" Then, type the following code in the last frame, and remove all of the graphics:
_root.inPlay = true stop()
Now make a movie clip called gameOver. Draw a rectangle and make a text field saying "GAME OVER! PLAY AGAIN?" Now make a text field saying "Type in password:" Then make an input text field with a variable name of passwordText. Finally, make a movie clip called wrongPassword and a movie clip called ok. In the ok movie clip, put in a red circle and a text field saying ok. Put a rectangle with a text field saying "WRONG PASSWORD" in the wrongPassword movie clip, and then put in the ok movie clip and in the actions panel, type in the following script:
on(press){
_parent._visible = false
}
This code just makes the wrongPassword movie clip invisible when you press the ok button. Put these in the gameOver movie clip. Give the wrongPassword clip an instance name of wrongPassword. Go to the actions panel for the gameOver movie clip(The first frame) and type in the following script:
wrongPassword._visible = false
After you've done that, go to the actions panel for the ok movie clip and type in the following script:
on(press){
for(a=1; a<=_root.passwords.length; ++a){
if(_parent.passwordText!=undefined && _parent.passwordText!=){
if(_parent.passwordText==_root.passwords[a-1]){
_root.level = a-1
_root.loadLevel()
_parent._visible = false
} else {
_parent.wrongPassword._visible = true
}
} else {
_root.level = 0
_root.loadLevel()
_parent._visible = false
}
}
} | » Level Intermediate |
|
Added: 2004-12-29 Rating: 6 Votes: 14 |
| » Author |
| I love making flash games but it's really annoying when Flash doesn't work! |
| » Download |
| Download the files used in this tutorial. |
| Download (17 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!