A friend of mine ask me if i could teach her how to create a simple maze game in Adobe Flash CS3 coded in actionscript 2, so i plan to share it with you also. using the mouse as your character moving only on the white area up to the end.
Things you will need:
a.) Adobe Flash cs3
b.) basic knowledge in AS2
c.) basic knowledge in Flash cs3
Tutorial:
1.) First lets open Adobe Flash cs3.
2.) in your first frame create a maze, any thing you want or you can copy mine.
3.) insert new layer, create a small box place a text inside type "start", convert to button.
open actions (F9) and place this code. (make sure you selected the button.)
on(release){4.) move the box at the beginning of your maze. (you will understand why)
gotoAndPlay(2);
}
5.) create new layer and place an "end" text at the finish line.
6.) insert new frame, leave the maze and the end text.
7.) now select the end button, double click to enter the button editor area.
8.) create a new layer and place a box on the hit frame.
9.) go back to your scene 1, while end button still selected open action(F9) type:
on(rollOver){10.) still on the 2nd frame select the maze and convert to symbol (movieclip), remember you should select all of the maze.
gotoAndStop(4);
}
11.) open action(F9) then enter this code:
on(rollOver){12.) then copy the first frame, maze and end frame in to a new fame(3rd), do the same procedure again, you should have 4 fames now. (remember it should be the first frame with out the codes in it.)
_root.gotoAndStop(3);
}
13.) on the 3rd frame place a text like "dead" or "loose" or any thing you want if the player touches the blue area.
12.) do the same in the 4th frame but this time its " you won" or "win" or anything you want if the player makes the maze.
14.) lastly, place a stop action on every 2nd layer just like mine.
code:15.) test the game hit ctrl+enter.
stop();
note: remember we place the box at the starting point of the maze because if you place it inside the blue area you will loose the game. (little logic only.)
hope you understand the tutorial, if you have any comment or suggestions pls. feel free to post it. thank you.
For more topics like this visit Designerslandmark
No comments:
Post a Comment