Programming games Problems. Schedule Various examples. Homework: rps, bo (don't go back to do this), cannonball, Video or Audio should be complete. Now.

Slides:



Advertisements
Similar presentations
1What is the Stage. 2How do you open a panel in Flash
Advertisements

 2004 Prentice Hall, Inc. All rights reserved. Chapter 18 – Macromedia Flash MX 2004: Building an Interactive Game Outline 18.1 Introduction 18.2 Object-Oriented.
Introducing ActionScript 3.0 Object-oriented programming language Used to power Flash Player Similar to JavaScript Can be embedded in a Flash project.
1 Flash Actionscript Event Handling. 2 Event Handling Right now we know all about variables lets go back to our text input/output example: Suppose we.
Flash Tutorials Learning Flash from Built-In Tutorials that Come as Part of Flash.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 9 "The games of a people reveal.
MovieClips & Properties Flash ActionScript Introduction to Thomas Lövgren
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
Chapter 17 Putting It All Together. Viewing the Preloader To view the preloader, 1.CTRL-Enter to test the movie. 2.View > Simulate Download.
© 2010 Delmar, Cengage Learning Chapter 6: Preparing and Publishing Movies.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Programming Games Computer science big ideas. Computer Science jargon. Show virtual dog Homework: [Catch up: dice game, credit card or other form.] Plan.
Chapter 3 Working with Symbols and Interactivity.
Programming games Flash drawing trick(s). Rock paper scissors. Classwork: Complete rock paper scissors.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Programming Games Basic HTML5 audio example. Catch-up. Work on basic video. Homework: Complete basic video.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
My First ACCESSIBLE Flash Movie. Course notes Detailed course notes, a printable copy of my slides, and all the samples shown today can be downloaded.
Chapter 11 Adding Sound and Video. Chapter 11 Lessons 1.Work with sound 2.Specify synchronization options 3.Modify sounds 4.Use ActionScript with sound.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
Interface & navigation (How to build a simple presentation interface) Flash ActionScript Introduction to Thomas Lövgren
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
® Copyright 2008 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH CS3.
Working with Symbols and Interactivity
Programming Games Show your simple video. More video examples. Audio. Classwork/Homework: Produce more complex video program.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Getting a handle on ActionScript A basic primer for non-programmers.
Programming games Flash drawing trick(s). Past due: Your completion of rock-paper-scissors) Classwork: Bouncing ball: read tutorial. Start coding.
Programming games Reflection Bouncing things, Memory Server-side: Survey. ActionScript 2 examples. Homework: Finish Video or Audio. Post proposal for your.
Programming games Examples. Classwork: work and show something of your final project. Homework: (finish…)
Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.
XP Tutorial 4 Special Animations. XP New Perspectives on Macromedia Flash MX Special Layers for Animation Animation Using a Motion Guide Layer.
7-1 OBJ Copyright 2003, Paradigm Publishing Inc. Using ActionScript and Creating Templates Macromedia Flash Design & Application.
Tutorial 7 Planning and Creating a Flash Web Site.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Flash! Macromedia Flash is the key to designing and delivering low-bandwidth animations, presentations, and Web sites. It offers scripting capabilities.
Programming games Registration experiment. Drawing. Equations of motion. Odds and ends. First phase of cannonball due. Preview video, audio. Homework:
Programming Games Preview Video & Audio. Work on cannonball. Homework: finish cannonball!
Chapter 16 Video. Importing Video Into Flash  Once you import video into Flash, you can control it using behaviors and very basic ActionScript, target.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
5-1 OBJ Copyright 2003, Paradigm Publishing Inc. Adding Sound, Video, and Basic Interactivity with Buttons Macromedia Flash Design & Application.
Distributed Multimedia Programming Week – 4A Buttons Movie Clips.
XP Tutorial 8 Adding Interactivity with ActionScript.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
line.net/ okpop.com/bar elythereflashin dex.html.
XP Tutorial 7 Creating a Flash Web Site. XP New Perspectives on Macromedia Flash 82 Objectives Plan and create a Flash Web site Create a Flash template.
Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video.
Adding Text and Navigation to the Home Page – Lesson 51 Adding Text and Navigation to the Home Page Lesson 5.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
Programming Games Show your rock-paper-scissors. Demonstrate bouncing ball. Demonstrate and examine Bo the dog. Homework: Modify Bo to make your own.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Programming games Flash concepts. Coin toss. Filezilla: upload your project(s) Homework: Enjoy Spring Break.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
© 2011 Delmar, Cengage Learning Chapter 11 Adding Sound and Video.
Programming Games Reprise: radio buttons. Creating instances at runtime. Buttons. Present your sound or video. Final project assignment. Homework: [Catch.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
XP Tutorial 8 Adding Interactivity with ActionScript.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
Adobe Flash Professional CS5 – Illustrated Unit A: Getting Started with Adobe Flash Professional.
Creating a Flash Web Site
Using Video, and Flash Components, and Printing Flash Content
Adding Buttons, Actions, and Sounds
Macromedia Flash Tutorial
Programming games Classes and objects (used for Jigsaw, Bouncing stuff, other projects) Homework: Complete cannonball. Video or Audio. Your own project.
Working with Symbols and Interactivity
Programming games Demonstrate cannonball
Presentation transcript:

Programming games Problems. Schedule Various examples. Homework: rps, bo (don't go back to do this), cannonball, Video or Audio should be complete. Now propose and plan your own project.

Recent problems: Names Need to give instance name to instance of movie clip symbol on the stage –The name of the symbol in the Library is NOT relevant. ActionScript refers to objects on the Stage using the instance name. –This also applies to buttons From Common Library Components Programmer-made –This also applies to text fields Selectable (dynamic) Editable (input)

Recent problems: frame to frame Remember to put stop(); in the Actions panel for a frame whenever you do want to stop on that frame! NOTE: if there are any syntactic errors, you will see the frames being re-displayed. Remember to check syntactic errors using the check icon. Also, use the format icon to examine the functions, if clauses, etc.

Know where your file is Don't Edit a.fla file in one place (say the Desktop) and Have another copy in another place (say, your Documents) and have a video or audio file in that place.

Schedule (Completed) rps, bo, cannonball –Cannonball: just hitting target or ground. Target crumbles. Video or Audio: one of examples OR modify rps or bouncing ball or cannonball OR ? Propose and then work on your own game –can be variant of 'my' games. Variant must have enhanced coding as well as graphics Can be enhanced version of Bo. Do something new with the coding. –can be something completely different… –can ask for help

Event handling Need to identify event Multiple steps –Declare object using var statement OR –Place instance on Stage, such as Button, and give name –Define a function that will do something in response to the event –Use addEventListener(event, functionname) OR have definition of a function as second parameter Recall: rock paper scissors

Examples mytimer.addEventListener(TimerEvent.TIMER,moveball) rockbtn.addEventListener(MouseEvent.CLICK, function (ev) { computermove("rock"); } ); May need to use HELP to figure out what the event is. For example, playback.addEventListener (VideoEvent.COMPLETE,playagain);

Run, Bo, Run You can download the source file Combination of cel animation (dog moving its legs) and computed animation (positioning bo instance like bouncing ball) Built up gradually, but the posted version does rotate the instance in 3D (around Y axis) to allow dog to run from right to left! Also a version with Sound –sound imported to frame in the symbol in the Library where Bo starts to run.

Interface Look at examples, source code and tutorials: coffee shop example –Created all by code: radio button pull down menu –text field (could have created this also by code but chose not to) Presidential preference –radio button

SharedObject Flash's version of cookies: –small files kept on client's (player's) computer to be used by restricted set of programs. –Also used for behavioral marketing!!! One way to get persistent data: data that stays around after program finishes.

navigateToURL See examples, source Go to URL (probably an html file) from Flash. –options to make new window or not.

Pre-loader Show something while the rest of a large Flash project loads –NOTE: Flash compresses content efficiently so it really has to be big AND/OR slow communications. Tutorial assumes that you have created the project and 'after the fact' decided to do a pre-loader.

Logic First frame: create a message Frame 5: label it "loading" Next frame, say frame 6: check if the whole file is loaded, if no, go back to "loading", else go to "main" Frame 10: label it "main", copy in original frames

timeline

Frame 1 import jigsaw.*; import flash.text.*; var loadMsg:TextField = new TextField(); loadMsg.text = "Loading..."; loadMsg.autoSize = TextFieldAutoSize.LEFT; loadMsg.border = true; loadMsg.background = true; loadMsg.selectable = false; addChild(loadMsg);

Frame after "loading" frame if (framesLoaded == totalFrames) { gotoAndStop("main"); } else { gotoAndPlay("loading"); }

Frame "main" This is the first frame of the original program, with one new line: removeChild(loadMsg); var p1:Piece = new Piece(41.6,48.1,piece1); var p2:Piece = new Piece(101.5,48.5,piece2); … Piece.buildit();

Suggestions You can do additional actions and/or have more graphics in frames 1 through "loading" Don't put in so much that that requires a loader

Cannonball Much of this is taste… Create a new layer, above the board, and put the ground instance in it. Place the target below the top of the ground. –Target will sink into ground –Ball will sink (slightly) into ground

Positioning You can move instances with the mouse You can change the x and y values –In Property Panel or in Info Panel You can write code to change positions during run time Same goes for width and height

Bouncing heads The code refers to a movie clip instance named ball. When you create the ball symbol in the Library (or when you edit it), you can change this to be…whatever you want –Some people like heads. You also can make the ball symbol a movie clip with multiple frames so it changes as it bounces in the ‘box’.

Comment Flash provides facilities for setting up symbols, instances of which, operate more or less independently….

Shooter demonstration shooter.fla file plus.as files defining a class for each of –Aa –Gun –Bar –Ground –Bomb

Note There are multiple aa's and bomb's. All these are defined as MovieClips in the usual way. Use Linkage to associate with an external file. The external.as file has coding.

Find places game Inspired by Lufthansa virtual pilot AND request for a game about NY CD 19 My game has additional feature of regions as well as points Demonstrate –note progression of features

Classwork/homework Work session Last project is totally your choice. You can build on sample projects.