06:17 PM 06:17 PM06:17 PM
 

How to orient an objet to an other ? Just put those lines and change the instance name myTank.

Download the source code here: [www.thisisgameplay.com]_Orient_object_to_mouse_cursor.fla

05:06 PM 05:06 PM05:06 PM
 

In my first tutorial I will show you how to make a flash game like Jetman.

A simple very famous casual game on facebook and very addictive.

Play Jetman

1. First of all you have to download the Adobe Flash IDE: Adobe Flash CS3 or Adobe Flash CS4

We will code the game with ActionScript 3.0 (the programming language of Flash) so you need Adobe Flash CS3 at least.
You can download the free trial version of Adobe Flash here (Mac or Windows) : https://www.adobe.com/cfusion/tdrc/index.cfm?loc=en&product=flash

2. Create your document

  • Open Flash.
  • Create a new ActionScript 3.0 document.
  • On the properties set the framerate to 25fps.
  • And set the background color to black.

3. Create Jetman MovieClip

Flash uses graphic objects called MovieClip. So we have to create the Jetman’s MovieClip.

  • Click on the Rectangle tool on the tools bar. (on the left)

create_box

  • Then drag and drop on the stage to create a rectangle about width:50px and height:15px (you can modify your shape dimentions later).
  • Select all your shape including the border. You can also use a double click.
  • Do a right click on your selected shape and click on Convert to Symbol.
  • Write this symbol’s name : Jetman (not jetman or JETMAN).
  • Then click OK.

Now you can see your Symbol Jetman into your Library  (on the right). If you don’t see the Library Press F11 key.
You have 1 instance of the Jetman symbol on your stage. Good. We just created a MovieClip.

In order to interact with the jetman MovieClip with ActionScript, we have the rename the instance’s name on the stage.

  • Click on the Jetman’s instance on the stage.

instance

  • Then go to the properties on the bottom and set the instance’s name to jetman (not Jetman or JETMAN) it’s very important.

instance_name

It’s done! Now we can move the instance with ActionScript.

4. Starting to code

You have differents ways to code with ActionScript. We will use the easier. (Coding into layers)

  • Create a new layer on the timeline (Click on the button on the left bottom corner).
  • Put the layer on the top: drag and drop the layer.
  • You can rename the layer with a double click or Right Click then rename.
  • Then select the first frame (here in black).

layer

  • Finally go to the windows menu > Actions or press the F9 key.

A new windows is opening : The Actions window. We will to write all our code here.

  • Copy and paste this Actionscript 3 code (After codinf into your layer you should see a little a into this frame):

  • Finally test your game. (hit CTRL+ENTER)

You should see that:

Download the source file here:

[www.thisisgameplay.com]_Jetman_step1.fla

Download the compiled file here:

[www.thisisgameplay.com]_Jetman_step1.swf

Next step the level design… ;)

http://photos-g.ak.fbcdn.net/photos-ak-sf2p/v43/106/4243149646/app_1_4243149646_252.gif