Programming games Registration experiment. Drawing. Equations of motion. Odds and ends. First phase of cannonball due. Preview video, audio. Homework:

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ADOBE FLASH CS4
Advertisements

1What is the Stage. 2How do you open a panel in Flash
© 2010 Delmar, Cengage Learning Chapter 7: Importing and Modifying Graphics.
Tutorial 4 Creating Special Animations. XP Objectives Create an animation using a motion guide layer Create an animation using a mask layer Animate text.
Macromedia Flash 5 Intermediate Level Course. Animation Basics Playhead In-Between Frames Keyframe Current Frame Number Framerate Current Time Frames.
Frame(GIF) and Vector Animation. Two Applications for Creating Animations 1.Photoshop – GIF Animation 2.Flash – Vector Animation.
1 Flash and Animation Presented by : Behzad Sajed Khosrowshahi.
Creating Animation Pertemuan Matakuliah: L0182 / Web & Animation Design Tahun: 2008.
Chapter 8 – Part I Interactive Multimedia Authoring with Flash: Animation “Computers and Creativity” Richard D. Webster, COSC 109 Instructor Office: 7800.
© 2010 Delmar, Cengage Learning Chapter 4: Creating Animation.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
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.
BUILDING RICH MEDIA ELEMENTS. Design Decisions Based on Design Specification  Following the design specification will ensure that the application is.
Introduction to Flash FYS100 Creative Discovery in Digital Art Forms Spring 2007 Burg.
Adobe FlashProfessional CS5 – Illustrated
Creating Special Effects
Tutorial 2 Drawing Text, Adding Shapes, and Creating Symbols.
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.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
1-1 OBJ Copyright 2003, Paradigm Publishing Inc. Dr. Joseph Otto Silvia Castaneda Christopher deCastro CSULA Macromedia Flash MX Introduction.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
© 2012 Adobe Systems Incorporated. All Rights Reserved. Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® INTRODUCTION TO FLASH ANIMATION.
Copyright © 2003 Pearson Education, Inc. Chapter 3, Slide 1 by Michael Kay The Web Wizard’s Guide to Flash.
® Copyright 2008 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH CS3.
® Copyright 2010 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH PROFESSIONAL CS5.
Working with Symbols and Interactivity
Programming Games Simulated ballistic motion: cannon ball. Classwork: Final day for midterm project and all projects for first part of class. Homework:
Creating a Logo – Lesson 3 1 Creating a Logo Lesson 3.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
Tutorial 1 Introducing Adobe Flash CS3 Professional
CSC 361/661 Digital Media Spring 2010 Professor Burg.
Flash Adobe Flash Introduction Kyungeun Park. Bitmap vs. Vector based  Bitmap –Bitmaps are made up of single pixels  Vector based –Vector graphics are.
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 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.
Tutorial 7 Planning and Creating a Flash Web Site.
Adobe Flash CS3 Revealed
Programming Games Preview Video & Audio. Work on cannonball. Homework: finish cannonball!
Frame, Timeline and Vector Animation. Purposes of Animation Capture viewers attention –exampleexample Explain a system or process –exampleexample Set.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
I MPORTING AND M ODIFYING G RAPHICS. 1. Understand and import graphics 2. Break apart bitmaps and use bitmap fills 3. Trace bitmap graphics Objectives.
Flash CS 5 Interface BY NSCHEWCZYK | ©2012. MENU BAR A bar at the top of the window. It lists menu options including: File, Edit, View, Insert, Modify,
Introduction to Flash CSC361/661 Digital Media Spring 2007 Burg.
Programming games Problems. Schedule Various examples. Homework: rps, bo (don't go back to do this), cannonball, Video or Audio should be complete. Now.
Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video.
Programming Games Show your rock-paper-scissors. Demonstrate bouncing ball. Demonstrate and examine Bo the dog. Homework: Modify Bo to make your own.
Flash Develop Rich Internet Content and Applications –Design motion graphics or build data-driven applications Flash Document = “.fla” filename extension.
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.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
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.
Chapter1 The flash interface and action script 3.0.
CIS 205—Web Design & Development Flash Chapter 3 Working with Symbols and Interactivity.
Adobe Flash Professional CS5 – Illustrated Unit C: Using Symbols and the Library Panel.
Flash Interface, Commands and Functions
Creating Complex Animations
INTRODUCTION TO ADOBE FLASH CS4
Animate Workspace. Objective % Utilize appropriate tools and methods to produce digital animation.
Chapter Lessons Create shape-tweened animations Create a mask effect
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
Develop Rich Internet Content and Applications
Programming games Demonstrate cannonball
ANIMATE WORKSPACE Stage Timeline Properties Panel Library Panel
Presentation transcript:

Programming games Registration experiment. Drawing. Equations of motion. Odds and ends. First phase of cannonball due. Preview video, audio. Homework: (1 week) Finish cannonball.

Reflection Now that you have worked in Flash, time to reinforce certain concepts. Always good to reflect on what you have done. –Why is the code written as it is? –Note: the code can be written different ways, just as prose can be different!

Registration/origin Defines the position of a movie clip –Origin and transform point may be different. Can adjust either one. Not necessarily the center of occupied pixels of the object YOU decide where you want that to be. Remember: if/when you change a symbol in the Library, it changes everywhere! –unlike changing the contents of a frame

Cannonball Tutorial gives the check for hitting the ground to be in terms of registration point of ball versus registration point of ground. This is a very quick test (quicker than hitTestPoint or hitTestObject) but will only work if the registration point for the ball is in the circle representing the ball and the registration point for the ground is on the ground.

Advice Experiment –create simple movie clips in the Library Brush size. Stroke vs Fill. –Move/make instances of them to the Stage –Observe the positions (X, Y) in the Property Panel Notice the origin (cross-hairs) and the transformation point (empty circle) –Write trace statements to reveal positions (properties.x and.y)

Bit map versus vector graphics When bringing an image created elsewhere into Flash, may need to convert to vector graphics –in order to slice up, manipulate,… Import / Import to Stage Modify Bitmap / Trace Bitmap copy and paste, then Modify Break Apart Modify Break Apart

Caution Transparent areas may need to be erased. –They do represent material! This could matter for hitTestPoint or hitTestObject. Note and modify as need be –origin –transformation point

Equations of motion displacement = time * velocity Traveling 20 miles/hour for 2 hours –40 miles Traveling 30 miles/hour for.5 hours??? Traveling 40 miles/hour for.75 hours???

Equations of motion change in velocity = time * acceleration Traveling at 30 miles/hour, accelerating (changing velocity) 2mile/hour/minute, then after 5 minutes, now going miles/hour = 40 miles/hour

Discrete calculations Going one speed at the start of an interval and a different speed at the end, calculate displacement using the average displacement = time * (vspeed1 + vspeed2)*.5

Ballistics Initial movement –cannonball leaves cannon at initial speed and direction ('at an angle') BUT we can only move things by moving them horizontally and vertically! Also, the vertical velocity will change because of gravity Use trig functions to calculate horizontal speed initial vertical speed (will change)

Comment Games involving pieces/avatars/etc. moving in 2D or 3D do make use of mathematical concepts! –Algebra –Geometry –Trigonometry

Syntax note The brackets make multiple statements the equivalent of a single statement You may see if (condition) statement; But using the brackets means you won't make a mistake if/when you add a statement if (condition) { }

Data types Numbers are not character strings (text) The number 12 is different from '12'. The latter is the character string numeral 1 followed by numeral 2. Contents of text boxes are text, that is, character strings. If your player is inputting a speed or an angle, your code must convert this to a number. Multiplying will do it! (and you probably didn't notice that a data type conversion (also called a cast) was taking place.

Compiling The Flash program translates / combines all the coding to make the thing that runs (the.swf file). This translation process is called compiling. Errors found during it are called compiler errors. Publishing is doing the translation and producing an.html file and a.swf file. You upload both (plus in certain situations other files) to the server. Links are to the.html file.

Flash.swf files are relatively small because they make use of the Flash plugin. The code in your program includes calls to routines in the plugin. Much of the graphics may be vector graphics: stored as formulas and not bit maps. Check out the file sizes.

Common problems Copying and pasting anything that looks like code from tutorial to your project. NOT naming things or being inconsistent. –The name of the Instance on the Stage is what matters for the coding If there are compiler errors, it will not work.

Issues My cannonball has nothing drawn directly on the Stage. It does have instances of symbols brought to the Stage and given names! –ball, cannon, ground, target It does have 2 input/editable text fields and 2 static/read-only labels You can add other things: –graphics/drawings directly on Stage – other instances

Caution A cannonball project is due in 1 week. You can do a fancier cannonball for your Flash project. –Note: fanciness needs to include some enhancements to the code –For example, Multiple targets Target undergoing different stages Different behavior by cannon or ball ?

Note I use the name cannon. To be more accurate, it is the barrel of the cannon, the part that rotates. The base of the structure does not change

Stroke and fill Certain tools (rectangle, oval) produce a stroke (outline) and a fill. You need to think about what you want! A stroke is not produced after the fact…at least I don’t think so.

Layers on timeline Used for graphical effects –Put the ground ABOVE the rest –Put interface ABOVE the rest

Video in Flash More than one way to incorporate video into Flash –bring in whole video that plays along with the frames. We will not use this way! For this class, we will use a FLVPlayback object Requires an import statement –This allows shorthand names for built-in parts of ActionScript Requires statement adding to Display list –Objects created in code (as opposed to put directly on the Stage) need to be added to the Display list to be shown.

Videos Different types of videos (like different types of images) Flash video playback requires videos of type.flv Can use Adobe Flash Media Encoder (part of the Adobe CS5 package) to take one type of video and produce an flv

Basic coding import fl.video.*; //get the builtin classes var flv:FLVPlayback; //set up variable flv = new FLVPlayback(); //give it a value flv.source= "dickey2.flv"; //set source attribute flv.x = 10; //position on screen horizontally flv.y = 10; // and vertically addChild(flv); // make visible by adding to // Display list

addChild Adds to the Display list. In my tutorials, you also will see canvass.addChild(stuff); This adds the newly created stuff object as a child of canvass. This will determine the positioning of stuff.

Skins These are the video clip controls. Appropriate when you want to give the player/user/customer more controls –You may choose NOT to give user control in certain cases Many choices USE HELP! Requires you to upload an.swf file to the server.

Files for your application Your application will consist of the following files. Say your application is called mywork.fla –mywork.html –mywork.swf –For each video: f1.flv, f2.flv, etc. The names f1, f2, need to be replaced by the names you gave the video. (Remember: no blanks!) –For each skin: the name of the skin file: xxxx.swf

Video examples Play back single video Play back choice of video (two ways) Bouncing Ball –Used mask to make the playback a circle Jigsaw puzzle turning into video –This can be your final project, not this 1 week assignment. ???

Video Use camera –Need to upload If not.flv, use Flash Media encoder to made an.flv Use (or other sites) to download video from YouTube –Note: I prefer you to use your own. If you use someone else's, you must make 'value-add' to the project.

Audio The name of the Flash object is Sound. The object for video is FLVPlayback. So I tend to say video and sound…. Two ways for including audio –associate with a frame See Bo the Barking Dog. –use code to get the sound file to set a Sound object to start and stop and….

Sample sound code import flash.media.Sound; import flash.net.URLRequest; var req:URLRequest=new URLRequest("missle.mp3"); var msound:Sound=new Sound(); msound.load(req); function playsound(event) { msound.play(); } playbtn.addEventListener(MouseEvent.CLICK,playsound); could be any URL

Homework Finish Cannonball (Due in 1 week) When you finish: start Sound or video project. Do something simple. You can build on it for the final project. –Buttons for choosing Video: With or without skin With saving using SharedObject –As part of other project Bouncing ball Rock-paper-scissors Cannonball (add sound when hitting target!) –??? Ask