Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming games Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break.

Similar presentations


Presentation on theme: "Programming games Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break."— Presentation transcript:

1 Programming games Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break.

2 Flash Environment for creating and testing Flash application –including writing code and creating graphics When you are done, you PUBLISH to produce a pair of files:.swf and.html. Many features in Flash: more than we will do.

3

4 ActionScript 3.0. We will NOT do ActionScript 2.0. Significant changes in the language.

5 Flash features Stage Timeline –frames –layers Properties panel Tool panel Window/Actions: where you write code for a layer of a frame in a timeline.

6

7 Flash object Movie clip –Timeline: 1 to any number of frames –code in any frame –Note: many of our movie clip symbols will have just one frame. Button –4 frames: up, over, down, hit Graphics We mainly will create movie clip symbols and place instances of them on the Stage at specific frames.

8 Coin toss Create 2 movie clip symbols and move instances to the Stage and NAME INSTANCES. –head –tail Look at Window/common libraries/buttons and get a button –alter this button to display FLIP. –name the button instance Write code in the [only] frame of the main movie (Scene 1) to –set up event handling for hitting the button –simulating random coin toss by making either head or tail visible and the other not visible.

9

10 Techniques Use rectangle/oval tool and keep shift key down to make a circle. In Library panel, right click on head, duplicate, rename tail to get same size. Use segmentation to erase parts… Change magnification to make larger to ease drawing.

11

12 NAME things Move instances of symbols to Stage. You need to give the instances names in order to reference them in ActionScript. While selected, in Properties panel, give a name. –It can be the same as the movie clip symbol name. In some applications, you may have more than one.

13

14

15 Buttons I will show you 3 ways to make buttons. –common library –do it yourself (rock paper scissors) –components This is Common Library way. Need to change Enter to Flip.

16 Change symbol in Library

17 Changing text… Need to unlock the text layer Pick up T tool make change return to Scene 1

18 Notice When you change something in the Library, all instances of it change on the Stage. Need to give the button instance on Stage a name: flipbtn.

19

20 Add coding Click off of any object so nothing is selected. Windows/Actions Write code

21

22 Testing Go to Control/Test movie/In Flash Professional When it works, File/Save As

23 Improvement Keep track of counts of heads and tails. Create 2 TLF read only and 2 selectable text fields Expand Character panel to change size and font and other features. Use x and y in Properties panel to line up. Name the selectable text fields. Modify code.

24 2 + 2 text fields

25 Changing code The text in the text field must be changed to a number before adding 1 to it and then changed back to text. The text is referenced using the name of the text field with.text

26

27 Homework [Finish and show coin toss with counts. Add anything else you want.] Enjoy break! You can do tutorials, practice drawing. You can look ahead to rock-paper- scissors, Bo the barking dog, etc.


Download ppt "Programming games Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break."

Similar presentations


Ads by Google