53 line game game programming in actionscript 3. create a new document fire up flash and create a...

12
53 Line Game Game Programming in ActionScript 3

Upload: esther-ryan

Post on 18-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

53 Line GameGame Programming in ActionScript 3

Page 2: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Create a New Document

Fire up Flash and Create a New Document with the settings:

Width: 480, Height: 320, Background: Dark Grey, Frame rate: 24

Page 3: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Select the Rectangle Tool(R) and draw a square on screen about 40px tall and wide.

Page 4: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

With the Selection Tool (V), select the square then go to

Modify>Convert to Symbol...(F8). Name the square“clsShip” make sure it’s type is MovieClip and the

registration is center.

Page 5: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

With your “ship” square selected, go to the Properties palette (Window>Properties) and type “ship” into the

textbox for <Instance Name>

Page 6: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Select the Oval Tool(O) and draw a circle on screen about 10px tall and wide.

Page 7: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Select the circle andConvert to Symbol like above. Name the circle “clsBullet”, make it’s type

MovieClip and registration center.This time, dropdown the Advanced settings. Check the box labeled

“Export for Actionscript” and in the“Class” text area type “bullet”. Leave all the other settings default.

Page 8: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

After you’ve created the symbol, select thebullet on the stage and delete it from the stage. In your

library window you can see the bullet still exists.

Page 9: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Repeat the steps from above by making another square about the same size as the first. Convert it to a symbol,

naming it “clsEnemy” and setting it’s class to “enemy”. Once you’ve completed that, delete it from the stage as well.

the only object on stage should be your original “ship” square.

Page 10: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Select the first frame of Layer 1 in the Timeline window and open the Actions (Window>Actions). Download the file

“Do-it-yourself ActionScript” and paste the contents into the Action window.

Page 11: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Now it’s time to test your file. Go to Control>Test Movie>Test. You should be able to move your “ship”

Squareup and down using the up and down Arrow keys and fire

your bullet using the Spacebar.

Page 12: 53 Line Game Game Programming in ActionScript 3. Create a New Document Fire up Flash and Create a New Document with the settings: Width: 480, Height:

Get Creative!That’s it. Pretty easy, huh? Now go get creative!