1 / 27

Programming games

Programming games. Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break. 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.

thale
Download Presentation

Programming games

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. ActionScript 3.0. • We will NOT do ActionScript 2.0. • Significant changes in the language.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. Change symbol in Library

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

  12. 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.

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

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

  15. 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.

  16. 2 + 2 text fields

  17. 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

  18. 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.

More Related