How to make a simple game in flash


















Now just animate it to make it appear and disappear. In my example it appears in frame 10 and disappears in frame Insert a new keyframe in frame 60 and another one in Insert keyframes from frame 50 to 60 and place the ball in different positions in every keyframe. That is the game over scene. You can also place a play again button just like the start game.

First of all go to intro and add a new layer. Insert this action to the layer :. After that, my sample starts the game from frame So in the actions layer, insert new keyframe in frame 49 and add these actions :. Remember, we had the ball in different positions in 10 keyframes after frame This command takes us to a random frame in 10 keyframes after frame Now go to the score board movie clip and double click to edit. Insert two frames. Now add a new layer and put two keyframes there.

In the last keyframe insert this command :. By using two keyframe the score will update quickly. All of them are an instance of one object. Add a new object that covers the ball perfectly and place in the exact timing when you need the ball to be clicked. This action minuses lives and score if the player fails to click. The easiest way to get buttons is to use the default ones that flash comes preloaded with. Next look through the library to find a button you like and then drag it onto the stage.

OK thats great but what about making your own buttons. This is also vary simple. Or right click on an existing shape like our instructables robot and select Convert to symbol then select button from the drop down menu and name it. In Flash everything is made up of symbols within symbols called nesting , even our really simple instructables robot button has two components the robot picture and the button itself. When you first create a button you go inside it in order to edit it you can tell what your in buy looking at the bar just above the stage however when you are outside the button you will not be able to edit it.

Then I added some stars to the instructables robot you can do whatever you like. Ok Only a couple more tings to do. Movement in flash is created by showing on object in a different position then it was before. It does this so fast that your eye is fooled into thinking something is moving. It is like drawing on each page and then flipping through them quickly except that instead of pages they are frames.

The most simple way of making an animation in flash is to make a series of keyframes in which the object moves a little in each one. This can be problematic unless you nest the animation in a movieclip. Making a movie clip is the same as making a button except in the drop down menu you select movie clip. The above process takes a long time. A tween is a sequence of frames that the program creates for you all you need to do is tell it were to start and were to end, it fills in the rest.

Making a motion tween is simple either right click on a section of Time frames and select create motion tween if a window pops up telling you a motion tween can only be applied to symbols. And asks you if you want to turn your current shape into a symbol just click OK.

You should now have your starting position for the tween to make the end position hold Ctrl a click on the end of the blue section of frames, then position the object in it's end position. Mine has four buttons answers , and some text. In order to add interactivness to our flash game we will need some code.

Flash uses action script sort of like java this is an object oriented programming language. The good thing about actionscript Action script 2 in this instructable is that you don't need to type any code.

The code is already written and can be accessed on the side of the actions panel. Or right click on a Symbol and select actions, or press F9. Now the first thing to do is navigate to the pre-written pieces of code we're looking for. Next click on the stage of the first frame. The actions panel should now say Action - Frame in the top right corner. After scroll down in the Timeline Control folder till you find stop. Double click on this. All done. The on press statement listens for when the button is pressed on by the mouse, it then executes what is in the curly brackets.

You put the frame you want into the brackets that follow it. One will take the player forward to the next question right answer code and one will take the player back to the tittle screen wrong answers. However you can also export them as swf's what youtube videos are or as. This type of quiz game is really simple to make and can be as simple or complicated as you like. If this instructable is received well i will try to make some more within the next 30 days so you're trial will still be active.

I will give in this article some interesting links to start with and go deeper too. Don't forget that Flash is just a tool. This article focuses on the technical aspect of the game developement but never forget that a game has many other aspects : game and level design, addictive game mechanics, graphics, and above all, it must be fun to play and innovative.

The "Try and buy" license allows to try it for 30 days. A good way to start with is to buy a book. But you can learn Flash and ActionScript 2 the scripting language of Flash 8 only by surfing around the net. Here are some good tutorials to start with : An excellent tutorial in 9 stages. You will learn to make a simple shoot them up game in 9 steps, each one adding a new functionnality to the game.

A nice selection of animated tutorials.



0コメント

  • 1000 / 1000