Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.

Slides:



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

IS660Z Programming Games Using Visual Basic Overview of Cannonball.
Visual Basic: ballistics
 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.
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.
1 Flash Actionscript Animation. 2 Introduction to Sprites We will now look at implementing Sprites in Flash. We should know enough after this to create.
Macromedia Flash 5 Intermediate Level Course. Animation Basics Playhead In-Between Frames Keyframe Current Frame Number Framerate Current Time Frames.
3.02 Computer Animation Software and Design Guidelines
1 Flash and Animation Presented by : Behzad Sajed Khosrowshahi.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
3.02 Computer Animation Software and Design Guidelines
© 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.
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.
Business and Computing Deanery Multimedia Week 6 Animation.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
1 SEG3120 Analysis and Design for User Interfaces Flash Anis Zarrad Parallel Simulations and Distributed Systems (PARADISE) Research Laboratory SITE, University.
© 2011 Delmar, Cengage Learning Chapter 9 Introduction to ActionScript 3.0.
Programming games Another sound example General review Homework: [finish project], look over study guide.
CT1514.  What is Motion Guide Layer?  Controls the movement of objects in a Motion tween animation  How to create a Motion Guide Layer?  Click on.
 2008 Pearson Education, Inc. All rights reserved Adobe ® Flash ® CS3: Building an Interactive Game.
Programming Games Simulated ballistic motion: cannon ball. Classwork: Final day for midterm project and all projects for first part of class. Homework:
Programming Games Show your simple video. More video examples. Audio. Classwork/Homework: Produce more complex video program.
XP Tutorial 1 Introduction to Macromedia Flash MX 2004.
CSC 361/661 Digital Media Spring 2010 Professor Burg.
Programming Games Show project. Refresher on coordinates. Scaling, translation. HTML5 logo. Refresher on animation. Bouncing ball. Homework: Do your own.
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.
More Tips on Flash CSC361/661 Digital Media Spring 2007 Burg.
Programming games Registration experiment. Drawing. Equations of motion. Odds and ends. First phase of cannonball due. Preview video, audio. Homework:
CSC 361/661 Digital Media Spring 2010 Professor Burg.
Programming Games Preview Video & Audio. Work on cannonball. Homework: finish cannonball!
Motion Tweening – Lesson 81 Motion Tweening Lesson 8.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
Programming Games Reprise on drawing on canvas. Jargon (concepts): objects. Demonstrate slingshot. Mouse events. Work on your cannonball. Homework: Finish.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
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.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
© 2011 Delmar, Cengage Learning Chapter 10 Using ActionScript to Enhance User Experience.
[My] Experiences building games in Visual Basic & Flash Focus on 'cannonball' Jeanine Meyer Math Senior Seminar.
Programming games Cannonball due. Drawing & printing example. Acquiring video or sound Homework: Catch up: complete projects (rps, Bo, cb). Start video.
Computer Game Design ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.
1 A Basic Introduction to Flash. Outline What is a flash? Macromedia Flash MX 2004 Flash concepts Flash Demos Conclusion Additional help 2.
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.
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.
CIS 205—Web Design & Development Flash Chapter 3 Appendix on Using Buttons.
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.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
Animation in flash. Frame-by-Frame Animation An animation is made from a series of framed images displayed one after the other to create the motion. Flash.
FINAL EXAM REVIEW 2015 Computer Game Design. 1 A. What is a.fla file?.swf file? B. Action Script is an example of what type of programming language? C.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
 Motion Tween allow us to move a shape on the stage from one place to another.  In order to use motion tween, the shape to be moved must be converted.
Tutorial 3 Creating Animations.
Creating Special Animations
Flash Interface, Commands and Functions
3.02 Computer Animation Software and Design Guidelines
Unit Lessons Work with actions
CT1514 Flash-2.
Programming games Classes and objects (used for Jigsaw, Bouncing stuff, other projects) Homework: Complete cannonball. Video or Audio. Your own project.
Programming games Demonstrate cannonball
Programming Games Reprise on drawing on canvas. Jargon (concepts): objects. Demonstrate slingshot. Mouse events. Work on animation project. Homework: Finish.
Exercise : Animated Navigation Structure in Animate (= Flash)
Presentation transcript:

Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a parabolic arc. Phase 2: checks for ball hitting ground or target. Phase 2a: target collapsing/exploding. Next project: sound or video.

Animation Is created by displaying sequences of pictures so that our eyes ‘see’ movement. Cel animation (aka frame by frame) is a sequence of distinct frames. The programmer creates the distinct frames. Computed animation is generated by code changing what is on the screen. This could be moving things around, changing shape, color, visibility, alpha, etc.

Tweening Flash provides a quick (quicker) way of producing the sequence of frames for cel (frame by frame) animation. –Motion tweening: specifying a movie clip instance or a shape moving along a path –Shape tweening: specifying a first and last shape This is still called frame by frame animation. Flash authoring environment helps out during creation time.

Reprise on animation Cel animation: use distinct frames –all drawn by programmer/creater or –some created by Flash itself –Examples: rock-paper-scissors, collapsing target in cannonball, Bo's legs Computed animation –code (written by programmer/creater) changes objects on Stage –Examples: ball in bouncing ball, ball in cannonball, movement of all of Bo.

Reprise: Text fields Text fields are created by the programmer and given [initial] values. –Read-only (Static) text fields do not change during runtime. Label parts of the Stage. –Selectable (Dynamic) text fields can be changed by code (written by the programmer during creation time) during run time. Show results. –Editable (Input) text fields can be changed by the player AND by code. Presumably, code (written by the programmer) reads/examines the input text fields changed by the player.

Programmer versus player Programmer (creator/developer) uses Flash to create (build) an application. Player is the name I give to the end-user of our applications. Programmer uses the Flash environment to build an application, including coding, drawing, etc…. Flash, 'the computer', does nothing by itself. Take ownership of what you do!

Hitting walls: Bouncing ball Angle of incidence equals angle of reflection Because the walls are horizontal and vertical, this means the change is pretty simple: –Hitting horizontal wall causes the vertical component to change sign –Hitting vertical wall causes the horizontal component to change sign

Cannonball Player changes/sets angle of cannon and speed of cannonball out of the mouth of the cannon Using a time event, ball moves according to [simple] model of ballistic motion: ball under effect of gravity— parabolic arc. –You will NOT see any quadratic equation. You will see mathematical expressions. –This is computed animation Code checks for hitting ground and hitting target. If ball hits target, target crumbles (or explodes—it is up to you). –This will be cel animation. You will draw the crumbling/exploding target. Demonstrate.

Overview cannonball 1 frame –target symbol has several frames 3 layers: for organization –May use additional layers for graphical effects: putting ground on top of ball. 5 symbols in Library –ball movie clip –ground movie clip –cannon movie clip –target movie clip –fire button Instances of those 5 symbols on the Stage (each named) Two editable/input text fields and two read-only text fields

ActionScript Main movie, actions layer –Global variables, including Timer object, –register listeners for Timer event and fire button event, Function for starting the cannon ball flight Function for Timer event that advances the cannonball –Later add code to check for collisions target symbol: initial design 1 frame –Later design: add frames and stop(); in first frame and last frame

Angles Flash (and most other programming languages) use radians for measuring angles. –Actually, Flash uses degrees for rotation attribute of objects and radians for trig functions. Radians is an intrinsic unit of measure. There are 2 * pi radians in a circle. Math.PI is a built-in constant. –Math.PI is equivalent to 180 degrees –Math.PI/2 is equivalent to 90 degrees –Math.PI/4 is equivalent to 45 degrees –angle_in_radians = angle_in_degrees * Math.PI / 180 We don't ask our player to think in radians! Our code does the conversion work.

Cannonball Phase 1: get arc working Phase 2: add checks, add frames to target –target crumbles –target movie clip symbol has cel animation You add frames to the target symbol in the Library The instance of the target symbol you have placed on the Stage will now have/be the new target –After hit, ActionScript code in the Main movie will be target.goToAndPlay(2) to advance the target to its frame 2 and subsequent frames.

Layers, hints Put all the material in the board layer of the first frame. –Give everything an instance name. Add layer for the interface elements: text field and buttons –Input text fields need the INSTANCE name. Add layer for actions If you want the target to sink into (behind) ground, you may make a new layer and move (cut and paste in place) ground instance to it. The layer with the ground is above the layer with everything else.

Advice The firecannon code positions the ball. If your cannon is different than mine, you may need to modify this part of the code. The hitTestPoint examines the material (occupied pixels) in the target clip versus the ball’s x and y position. –Make sure the origin of the ball is in its center! The check for reaching the ground is done in terms of the ground's origin –Make sure this is on the ground!

CB issues You need 4 text boxes!! –The read-only/static text field containing the word speed –The editable/input text field with instance name speed. It holds text representing a number. –The read-only/static text field containing the word angle (could be degrees) –The editable/input text field with instance name anglein. It holds text representing a number. NOTE: the application starts with values in speed and anglein

CB issues The default for Flash is to go frame to frame so…. For the crumbling target you need to put stop(); in the first frame and the last frame

Classwork/homework Read tutorial! Read the whole thing and then go back and create the application, starting with just getting the ball to go in an arc. –You need to create cannon, ball, ground, and simple, 1 frame target symbols. Move to Stage and name. –You need to get a button from Common Library. Name. –You need to write code. Create 1 Timer object. Code for event handling (addEventListener) for button and timer. [Can add code for checking for hitting ground and target later.]

Homework Cannonball phases. GET first phase working BEFORE GOING ON. –Note: testing the program means to test when the ball hits the target AND when it does not hit the target. You also should include going all the way over the target. –Can wait to create frames of collapsing/exploding target until rest of program works. Advance notice: Video or Audio –read tutorials. Look at source files –Think about how you will acquire video or sound files.