Programming games Flash drawing trick(s). Past due: Your completion of rock-paper-scissors) Classwork: Bouncing ball: read tutorial. Start coding.

Slides:



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

Flash animation For beginners. Lesson objectives To understand how to animate a ball To understand how to loop animations To learn how to use animation.
CIS 205—Web Design & Development Flash Chapter 3 Appendix B on Creating Animations.
 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.
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
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.
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.
© 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.
Frame Part of timeline panel You can remove normal frames from a certain layer by (MRC + Remove Frames). You can remove normal frames from a certain layer.
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.
Introduction to Flash FYS100 Creative Discovery in Digital Art Forms Spring 2007 Burg.
Click your mouse for next slide Flash – Introduction and Startup Many times on websites you will see animations of various sorts Many of these are created.
Exercise : Animated Navigation Structure in Flash 1.Develop Answers to “What did you learn in ITI program?” “What do you have to offer?” “What are your.
Flash MX II. Flash MX – Tweened Animation There are two methods for creating an animation sequence in Flash –Frame-by-frame animation –Tweened animation.
Programming Games Basic HTML5 audio example. Catch-up. Work on basic video. Homework: Complete basic video.
Lehigh University Introduction to Flash MX Sharmeen Mecklai.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Button library Create a button Learn.
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.
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.
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 © 2003 Pearson Education, Inc. Chapter 3, Slide 1 by Michael Kay The Web Wizard’s Guide to Flash.
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.
Introduction to Flash. Topics What is Flash? What can you do with it? Simple animation Complex interactive web application, such as an online store. Starting.
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 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.
More Tips on Flash CSC361/661 Digital Media Spring 2007 Burg.
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!
Frame, Timeline and Vector Animation. Purposes of Animation Capture viewers attention –exampleexample Explain a system or process –exampleexample Set.
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.
Distributed Multimedia Programming Week – 4A Buttons Movie Clips.
Building the Events Components– Lesson 111 Building the Events Components Lesson 11.
1 Flash Basics Exercise Guide Making Animated Text  1.1 Open Flash 5.0 working environment frame 1  1.2 Highlight frame 1 of the first layer Insert.
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.
XP Tutorial 2 Drawing, Adding Text, and Creating Symbols.
Programming games Context of what we are doing. Drawing on canvas. Homework: [Complete coin toss examples.] Do your own drawings. Upload files to website.
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.
Programming Games Show your rock-paper-scissors. Demonstrate bouncing ball. Demonstrate and examine Bo the dog. Homework: Modify Bo to make your own.
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.
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.
XP Tutorial 3 Creating Animations. XP New Perspectives on Macromedia Flash MX Elements of Animation Layers are used to organize the content of.
Flash 1. Document Properties Set frame rate and dimensions of project Set frame rate and dimensions of project (default width=550 and height=400)
Flash Interface, Commands and Functions
Macromedia Flash Tutorial
Unit Lessons Work with actions
CT1514 Flash-2.
Flash animation For beginners.
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
Flash Demonstration – Unit 5 – ActionScript 3.0
Exercise : Animated Navigation Structure in Animate (= Flash)
Exercise : Animated Navigation Structure in Flash
Presentation transcript:

Programming games Flash drawing trick(s). Past due: Your completion of rock-paper-scissors) Classwork: Bouncing ball: read tutorial. Start coding.

Flash drawing segmentation of drawing: –select parts, –add on by using shift key –also use lasso or rectangle select tools move modify (transform)

Flash You can change position and dimensions selecting an object and using the Properties panel –W –H –X –Y Try this! You can use this to make sure an oval is a square. to get the origin (cross-hairs) where you want them to be. to line up and space out related objects.

Flash distinctions In [my] rock-paper-scissors, instances of scissors button present on Stage in each frame scissors button in Library –graphical material in each of the 4 frames of the scissors button in Library For making the animated sequences, I copied-and- pasted from the graphics in the Up frame of the scissors button in the Library. I then modified the graphics on the Stage. There was no change in the scissors in the Library.

Show your work Reminder: slow and steady Get logic working and then add/enhance the graphics and add animation Don't be skimpy on frames Put in stop(); in the last frame of each animated sequence.

Common problems Forgetting to insert keyframe Using the whole button instead of graphics that were in a frame of the button Working on different layers Omitting stop();

Random This is the same as JavaScript! Math is a class. Math.random is the name of one of the class methods. Math.random() is a call to the class method. [This is the jargon—learn it!] Math.random() produces a random fraction from 0 up to (but not including) 1 Math.floor(Math.random()*n) [assuming n is a variable holding a positive integer] produces integers from 0 up to (n-1)

Symbols Movie clips Button Graphics Symbols are created and remain in the Library. You bring instances to the Stage. Note: you can draw directly on the Stage (just like you draw to make a movie clip). Create graphics symbols in the Library when you want to repeat a symbol. You bring instances to the Stage. Changing the symbol in the Library changes all instances on the Stage.

Flash publishing Save As/Save: saves the source aka development version.fla file Publish: creates.html and.swf versions. You can examine any of the.html files Make sure your saved.fla and the published files are the same version. You can upload the.fla file to your website for storage. –I sometimes do this to make the source available to students. You upload the.html and the.swf to share/show to everyone on the Web. The file to be linked to is the.html file.

Bouncing ball overview Three layers (board, interface, actions) –Can also make a ball layer underneath the board layer holding the walls OR make sure you bring the ball to the Stage before any wall instances. 1 frame Use Timer object to produce an event every so often –Recall setInterval

Animation in bouncing ball (and cannonball) Code Changes the Stage, that is re-positions the ball instance every interval of time. Just one Timer object –Don't blindly copy code! Uses the running attribute of the timer object to determine if 'in flight‘. Uses variables and calculations to determine horizontal and vertical position changes (aka displacements)

Interface Button (shows either Stop or Start) –Component instance. Note: you could make your own button. Input Text field –Input means the player can change it –Note: Use speed.text to access what the player typed in.

Warning We are using ActionScript 3.0. There were significant changes from ActionScript 2.0 to 3.0. Not so significant from CS3 to CS4.

Timer object var mytimer:Timer= new Timer(200); This creates a Timer object that will have a timer event every 200 milliseconds. The new is what creates a new object. var timer1:Timer= new Timer(5000,3); This creates a Timer object that will have a timer event every 5 seconds, and stop after 3 of them…. The mytimer and the timer1 are my names for these variables. Note: the bouncing ball application did NOT use anything named or similar to timer1.

Event handling At this point, the Timer objects exist but neither one has been started and no event handling has been set up. mytimer.addEventListener(TimerEvent.TIMER, moveball); This sets up the event handling: when the TIMER event happens, the moveball function will be invoked. The moveball is my name for a function I wrote! One more thing to do: mytimer.start();

What to do? I want to move the ball, that is, the movie clip instance on the Stage that I have named ball. ball.x += xd; ball.y += yd;

Walls Remember: there are no walls!!! However, you can write code to do a calculation. if rightwall.hitTestPoint(ball.x, ball.y, true) { … } This asks the question: is the x,y location of the ball (where this is depends on how you drew the ball) within the non-blank pixels of the rightwall.

Button There is a button to start and stop the action. It has a label that the code changes. Much of this is the same as you have already done!

Speed field This is an INPUT text field, meaning that the player can change it as well as code. The value is accessed using = speed.text Need to convert from text to number = Number(speed.text); Make sure the initial text has no blanks and represents a positive > 0 number! –Dynamic text fields can be changed by code. –Static text fields cannot be changed after set at Design time. Think about design time versus runtime This value is used to set the xd and yd values.

Now… Read whole tutorial and build your own bouncing ball

General concept: Objects Objects are objects of a specific class. So far, we've only used built-in classes. Objects have –properties Also Known As attributes AKA data AKA information –methods AKA code AKA behavior Examples –head.visible, ball.x –mytimer.addEventListener –In cannonball: target.goToAndPlay(2); In rps, we used gotoAndPlay("breaks") for the main movie so we didn't need the dot (.)

Classes Built-in classes include –movie clip –Timer –FLVPlayback –Sound Programming defined classes –See their use in other examples bouncing things shooter jigsaw puzzle

Demonstrate Bouncing stuff (different size and color balls) Bouncing things (3 different shapes, different size and colors) Makes use of external.as files. Bouncing things demonstrates use of common code for some aspects of 'thing' creation and behavior You can come back to this later for your special Flash project.

Classwork/Homework Complete bouncing ball Preview: Read cannonball tutorial Will discuss cannonball issues next class.