Computer Game Design 101. 2 ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Alice Inheritance and Event Handling. Inheritance Concept Consider this hierarchy; parents describe properties of children Animals Vertebrates MammalsFish.
© 2010 Delmar, Cengage Learning Chapter 9: Using ActionScript.
 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.
True or false A variable of type char can hold the value 301. ( F )
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
Flash Workshop Flash Workshop :: Agenda  Introductions  Look at a few Flash Examples  Flash Web Sites  Flash Web Applications  Flash Games.
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 Advanced Level Course. Using Actions Toolbox ListActions List Parameters area Add/Delete a StatementMove Action Up/Down Expand/Collapse.
Kapi’olani Community College Art 258 Interface Programming II In-class Presentation Week 5A.
Visual Basic: An Object Oriented Approach 3 – Making Objects Work.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Adding Automated Functionality to Office Applications.
GAME:IT Junior Bouncing Ball Objectives: Create Sprites Create Sounds Create Objects Create Room Program simple game.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Chapter 3 Working with Symbols and Interactivity.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Button library Create a button Learn.
Tutorial 5 Making a Document Interactive. XP Objectives Explore the different button states Add a button from the Buttons library Edit a button instance.
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.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Creating a Logo – Lesson 3 1 Creating a Logo Lesson 3.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
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.
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
Linux Operations and Administration
Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.
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.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script "The games of a people reveal.
Motion Tweening – Lesson 81 Motion Tweening Lesson 8.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
XP Tutorial 8 Adding Interactivity with ActionScript.
Programming games Problems. Schedule Various examples. Homework: rps, bo (don't go back to do this), cannonball, Video or Audio should be complete. Now.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
© 2011 Delmar, Cengage Learning Chapter 10 Using ActionScript to Enhance User Experience.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
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.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
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.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Review of Previous Classes Declaring Variables - var myVar:DataType = value Data Types – Number, uint, String, Boolean Functions – parameters, return.
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.
© 2011 Delmar, Cengage Learning Chapter 11 Adding Sound and Video.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Intro to ActionScript CIS 126 Greg Shorts. What Is ActionScript? ActionScript is the scripting language Flash uses to control its movies and the objects.
XP Tutorial 8 Adding Interactivity with ActionScript.
AD 305 Electronic Visualization I : School of Art and Design : University of Illinois at Chicago : Spring 2007 Intro to Action Script "The games of a people.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Topic 02: Introduction to ActionScript 3.0
Creating a Flash Web Site
MOM! Phineas and Ferb are … Aims:
ActionScript Basics 2016 (2.0 – 3.0)
Unit Lessons Work with actions
INTRODUCTION TO ADOBE FLASH CS4
Interface Programming 2 Week 1
T. Jumana Abu Shmais – AOU - Riyadh
Working with Symbols and Interactivity
ICT Gaming Lesson 3.
MovieCLip Instances & ActionScript
Flash Demonstration – Unit 5 – ActionScript 3.0
Presentation transcript:

Computer Game Design 101

2 ActionScript is… Object-oriented programming Everything you do in ActionScript does something to some object* Some objects are called Symbols in Flash –Movie Clip –Graphic –Button * anything you can manipulate in some way

3 Object oriented? You can decide what happens when a user clicks a button without worrying about how the button (or program) knows that it has been clicked You can decide what changes to make to an object’s properties without knowing the internal mechanics of how those changes were made You can program tasks incrementally without sitting down and writing the whole program from start to finish in one session

4 ActionScript Deconstructed Class: a group of items that are similar in some way –Items are called objects or instances of the class Objects can be concrete (like a button or graphic) or abstract (like a variable that is invisible, but hold data) Objects have two aspects form (properties) and function (methods) Each property and method is defined by Actions (pieces of code that tell Flash how to manipulate a target object at any point in your movie).

5 ActionScript Metaphor Ball could be considered a class of items defined as “spherical things” –One object in this class is a movie clip called Tennis_ball The properties of Tennis_ball might be the color neon green or a 20-pixel diameter Its methods might be bounce, roll, and/or spin –A 2 nd object in the ball class might be Softball Properties white…etc.

6 ActionScript Flow Flash executes ActionScript statements starting with the first statement and continuing in order until it reaches the final statement or a statement that instructs ActionScript to go somewhere else.

7 One type of action that sends ActionScript somewhere other than the next statement is an if statement

8 Actions Tell Flash to do something –Frame actions –Object actions Actions also can have parameters

9 gotoAndPlay This frame action sends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene.

10 Functions Perform a specific task Like in a spreadsheet program (Excel)

11 getVersion Returns the Flash Player version number and operating system information. You can use this function to determine whether the Flash Player that is in use can handle your Actionscript.

12 Properties All available information about an object You can use ActionScript to read and modify object properties All property names begin with an underscore (e.g., _visible)

13 _visible = false This property make an object invisible Assign the following action to a button… On (release) { _visible = false; } Button disappears on mouse click

14 Method Similar to actions in that they effect objects Built into objects Invoked (Executed) through dot notation

15 RocketMC.gotoAndPlay(“BlastOff”); ActionScript notation must end in ; Movie clip Rocket MC goes to a frame labeled BlastOff and plays

16 Variables hold data for use in your Flash movies Variables can hold any type of data You could store: –User name –Result of calculation –True or false value

17 Expressions An expression is any statement that Flash can evaluate and that returns a value. You can create an expression by combining operators and values or by calling a function.

18 Operators Expressions use operators to tell Flash how to manipulate the values in the expression. They are the commands that say “add these values” or “multiply these numbers”

19 Some types of operators Assignment: are used to assign values to variables. The most common is (=). It makes the variable on the left equal to the value of the variable or expression on the right. Comparison and equivalence: ( ), (< =) Numeric: perform mathematical operations on values

20 Looping When you need to repeat certain actions in your movies more than once. Makes coding more efficient, using the same set of commands as many times as necessary to complete a task.

21 Looping examples while Creates a loop that continues to repeat as long as a condition remains true for Creates a loop that executes a specific number of times using a counter for…in Creates a loop that executes once for each member of a group of objects (class) This makes certain that the entire group of objects is processed in the same way

22 Hints Before you begin writing scripts, formulate your goal and understand what you want to achieve. Planning your scripts is as important as developing storyboards for your work. Start by writing out what you want to happen in the movie, as in this example: –I want to create my whole site using Flash. –Site visitors will be asked for their name, which will be reused in messages throughout the site. –The site will have a draggable navigation bar with buttons that link to each section of the site. –When a navigation button is clicked, the new section will fade in at the center of the Stage. –One scene will have a contact form with the user's name already filled in.