SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Advanced ActionScript Concepts
    IT 7220

    February 23, 2009


Sunday, February 22, 2009            1
Agenda

         Syllabus Updates
    ✤




         Game Assessment Papers
    ✤




         Rosenzweig - ActionScript 3.0/Game Programming University
    ✤




         Building Game Elements in ActionScript 3.0
    ✤




         HOT Lab - Flash Components and Forms
    ✤




         Work in Project Teams
    ✤




Sunday, February 22, 2009                                            2
Rosenzweig GP University

         Flash Game University (http://flashgameu.com/)
    ✤




               Companion Website to Book
          ✤




               Source code for all games referenced in text
          ✤




               Video tutorials
          ✤




               Blog
          ✤




               Forums
          ✤




Sunday, February 22, 2009                                     3
Rosenzweig Chap 1 Overview

         Review of Flash Interface
    ✤




         ActionScript in timeline and using document class files
    ✤




         Condition statements
    ✤




         Loops - For, While, Do
    ✤




         Use of Flash ActionScript Debugger
    ✤




         Game Programming Checklist
    ✤




Sunday, February 22, 2009                                         4
Simple ActionScript Program

         HelloWorld1.fla
    ✤




               ActionScript in timeline, output using Trace Function
          ✤




Sunday, February 22, 2009                                              5
Placing Objects on Stage

         HelloWorld2.fla
    ✤


               Still working with
          ✤

               ActionScript in the Timeline
               Create text field object
          ✤


               Assign a value to it
          ✤


               Place on stage (in display list)
          ✤


               No text parameters for control
          ✤
                                                            Stage
               over placement or appearance       (Display Object Container)


               of object
                                                      Main Timeline
                                                  (Display Object Container)




                                                         TextField
                                                      (Display Object)




Sunday, February 22, 2009                                                      6
Document Class Library

         HelloWorld3.as
    ✤


               All document classes are
          ✤

               derived from either the
               MovieClip or Sprite class
               MovieClip class is a container
          ✤

               class which includes the
               stage and timeline with each
               instance created
               This allows the text object to
          ✤

               be added to the movie clip
               Document class must then be
          ✤

               added to the Flash project file
               using the properties panel

Sunday, February 22, 2009                       7
Rosenzweig Chap 2 Overview

         Creating and working with visual objects
    ✤




         Player input
    ✤




         Controlling animation with ActionScript
    ✤




         Player Interaction via the Keyboard
    ✤




         Accessing external data
    ✤




         Arrays
    ✤




Sunday, February 22, 2009                           8
Visual Objects - Movie Clips

         We can add movie clips to our project by dragging them from the
    ✤

         library to the stage, and then adjusting appearance using the
         properties panel

         It is also possible to add movie clips from the library solely with
    ✤

         ActionScript, by setting the symbol linkage properties

         Lets take a look at the mascot movie clip in UsingMovieClips.fla
    ✤




         The MC timeline has four layers to make it easier to change the
    ✤

         animation a single part of the movie


Sunday, February 22, 2009                                                      9
Create MC Objects - Flash Interface



         Drag as many instances of a movie clip symbol onto the stage as you
    ✤

         want

         Position using select tool/properties
    ✤




         Scale and rotate using free transform tool
    ✤




Sunday, February 22, 2009                                                      10
Create MC Objects - ActionScript


         First, we make the movie clip accessible to ActionScript by setting the
    ✤

         Linkage properties (see Fig 2.2, p 43): enter Class name and select
         Export for ActionScript

         Next we use ActionScript to create a single instance on the stage at
    ✤

         x=275, y=150, and rotating the movie clip 10º to the right

         Finally, using a For loop, we create 10 additional instances of the
    ✤

         movie clip at y=300, spaced 150 pixels apart from each other, scaled at
         50% of the size of the symbol class



Sunday, February 22, 2009                                                          11
Button Creation in ActionScript


         Buttons can be made from either movie clips or button symbols stored
    ✤

         in the library

         As we have seen, an event listener:
    ✤

                     objectName.addEventListener(MouseEvent.CLICK, objectFunction);
         is then used to link a button to an action

         Lets take a look at MakingButtons.fla
    ✤




Sunday, February 22, 2009                                                             12
Simple Shapes in ActionScript


         It is possible to create simple
    ✤

         graphics entirely within
         ActionScript such as lines,
         rectangles, circles, and ellipses

         Closed shapes can also be filled
    ✤

         in

         Lets take a look at
    ✤

         DrawingShapes.fla



Sunday, February 22, 2009                    13
Using Sprites in ActionScript

         The Sprite class is a basic display list building block: a display list
    ✤

         node that can display graphics and can also contain children.

         A Sprite object is similar to a movie clip, but does not have a timeline.
    ✤

         Sprite is an appropriate base class for objects that do not require
         timelines. For example, Sprite would be a logical base class for user
         interface (UI) components that typically do not use the timeline.

         The Sprite class is new in ActionScript 3.0.
    ✤




         Lets take a look at CreatingSpriteGroups.fla
    ✤




Sunday, February 22, 2009                                                            14
Managing the Display List


         As we add objects to the display list, the last object added appears in
    ✤

         front of previously added objects

         We manage the position of “children” on the stage using
    ✤

         setChildIndex (first position is 0)

         Lets take a look at SettingSpriteDepth.fla
    ✤




Sunday, February 22, 2009                                                          15
User Input in ActionScript

         Mouse Input
    ✤


               Use event listener to track mouse movement and rollover
          ✤

               MouseInput.fla
         Keyboard Input
    ✤


               Use event listeners to detect key press (requires ASCII codes)
          ✤

               KeyboardInput.fla
         Text Input
    ✤


               Using AS to set input type, properties and actions
          ✤

               TextInput.fla


Sunday, February 22, 2009                                                       16
User Interaction in ActionScript


         Many games allow interaction with an object using the arrow keys
    ✤

         MovingSprites.fla

         Another common method of interaction is dragging an object using
    ✤

         the mouse. The example creates an instance of the Point() class to
         track movement.
         DraggingSprites.fla




Sunday, February 22, 2009                                                     17
Rosenzweig - Wrap-up

         Chapter 2 covers a lot things you can do with ActionScript for
    ✤

         creating games

         Be sure to review the additional sections:
    ✤




               Random numbers and Shuffling an Array
          ✤




               Accessing external data
          ✤




               Collision detection
          ✤




               Animation examples
          ✤




Sunday, February 22, 2009                                                 18
HOT - Components and Forms

         You can create a form in html that includes text entry fields, check
    ✤

         boxes, radio button, combo boxes, lists, etc. You can also set the tab
         order for the form elements to aid in usability. The contents of the
         form may then be submitted using either a form post method or by
         calling a script.

         Submitting form contents is generally via server-side script to tell
    ✤

         what to do with the form contents. Scripts may be in JavaScript, Perl,
         ASP.NET, Visual Basic, or other scripting languages.

         Flash allows the creation of Forms, creating rich-content user
    ✤

         applications using a set of pre-defined component classes which may
         be instantiated using the stage or through ActionScript.

Sunday, February 22, 2009                                                         19
HOT - Working with Components


         Chap 15 builds a form in Flash using the Flash UI Components in
    ✤

         ActionScript 3.0

         Components are accessed via the Components Panel and are
    ✤

         automatically added to the Library when they are dragged to the
         stage

         In the example, components are configured using the Properties/
    ✤

         Parameters panel, although this could also be done using the
         Component Properties panel or in ActionScript



Sunday, February 22, 2009                                                  20
HOT - Creating a Form



         Take a look at:
    ✤




               orderForm_Final.fla
          ✤




               orderForm.fla
          ✤




Sunday, February 22, 2009           21
Team Activity



         Begin working on storyboard
    ✤




         What role with prototypes play?
    ✤




         Finalize project plan
    ✤




Sunday, February 22, 2009                  22

Más contenido relacionado

Destacado (20)

Basic Game Frameworks
Basic Game FrameworksBasic Game Frameworks
Basic Game Frameworks
 
Design Strategy
Design StrategyDesign Strategy
Design Strategy
 
Ecml2010 Slides
Ecml2010 SlidesEcml2010 Slides
Ecml2010 Slides
 
Technology Applications in Education and Training
Technology Applications in Education and TrainingTechnology Applications in Education and Training
Technology Applications in Education and Training
 
PLN4PD
PLN4PDPLN4PD
PLN4PD
 
Listen Richard
Listen RichardListen Richard
Listen Richard
 
Introduction to Games and Simulations
Introduction to Games and SimulationsIntroduction to Games and Simulations
Introduction to Games and Simulations
 
Media literacy workshop
Media literacy workshopMedia literacy workshop
Media literacy workshop
 
Kare Bins
Kare BinsKare Bins
Kare Bins
 
#svjun26 South Vermillion Community Schools
#svjun26 South Vermillion Community Schools#svjun26 South Vermillion Community Schools
#svjun26 South Vermillion Community Schools
 
Social Learning Part B
Social Learning Part BSocial Learning Part B
Social Learning Part B
 
Eswc2009
Eswc2009Eswc2009
Eswc2009
 
Eswc2009
Eswc2009Eswc2009
Eswc2009
 
Digital Curation and Methods for Teaching Digital Literacy Skills
Digital Curation and Methods for Teaching Digital Literacy SkillsDigital Curation and Methods for Teaching Digital Literacy Skills
Digital Curation and Methods for Teaching Digital Literacy Skills
 
Applying Game Concepts To Learning
Applying Game Concepts To LearningApplying Game Concepts To Learning
Applying Game Concepts To Learning
 
Fanizzi Ilp2008 Dl Foil
Fanizzi Ilp2008 Dl FoilFanizzi Ilp2008 Dl Foil
Fanizzi Ilp2008 Dl Foil
 
Fanizzi Ilp2008 Kernel
Fanizzi Ilp2008 KernelFanizzi Ilp2008 Kernel
Fanizzi Ilp2008 Kernel
 
Bgp (1)
Bgp (1)Bgp (1)
Bgp (1)
 
Telecom Sourcing Accountibility
Telecom Sourcing AccountibilityTelecom Sourcing Accountibility
Telecom Sourcing Accountibility
 
Tuna Pax
Tuna PaxTuna Pax
Tuna Pax
 

Similar a Advanced ActionScript Concepts and Game Development

JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureSimon Willison
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
ArchGenXML / UML and Plone
ArchGenXML / UML and PloneArchGenXML / UML and Plone
ArchGenXML / UML and PloneJazkarta, Inc.
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsFlorian Weil
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishingGilbert Guerrero
 
MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"Theo Rushin Jr
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.jsVerold
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Paris Android User Group
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MITjeresig
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpGoogleTecTalks
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for youSimon Willison
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementWannitaTolaema
 
Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07carsonsystems
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkitCocoaHeads Tricity
 
Silverlight: Designer and Developer Workflow
Silverlight: Designer and Developer WorkflowSilverlight: Designer and Developer Workflow
Silverlight: Designer and Developer Workflowroberto.design
 
Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashGilbert Guerrero
 
JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017ElifTech
 
Building an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / PoseidonBuilding an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / PoseidonJazkarta, Inc.
 
Silverlight 2 For Developers
Silverlight 2 For DevelopersSilverlight 2 For Developers
Silverlight 2 For DevelopersMithun T. Dhar
 

Similar a Advanced ActionScript Concepts and Game Development (20)

JavaScript Libraries: The Big Picture
JavaScript Libraries: The Big PictureJavaScript Libraries: The Big Picture
JavaScript Libraries: The Big Picture
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
ArchGenXML / UML and Plone
ArchGenXML / UML and PloneArchGenXML / UML and Plone
ArchGenXML / UML and Plone
 
Moving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, trapsMoving from AS3 to Flex - advantages, hazards, traps
Moving from AS3 to Flex - advantages, hazards, traps
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishing
 
MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"MATE: A Flex Framework - "Extreme Makeover"
MATE: A Flex Framework - "Extreme Makeover"
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.js
 
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
Introduction to Honeycomb APIs - Android Developer Lab 2011 Q3
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch Up
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory Management
 
Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07Chris Wilson @ FOWA Feb 07
Chris Wilson @ FOWA Feb 07
 
2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit2013-03-07 indie developer toolkit
2013-03-07 indie developer toolkit
 
Silverlight: Designer and Developer Workflow
Silverlight: Designer and Developer WorkflowSilverlight: Designer and Developer Workflow
Silverlight: Designer and Developer Workflow
 
Artdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To FlashArtdm170 Week5 Intro To Flash
Artdm170 Week5 Intro To Flash
 
JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017JS digest. Mid-Summer 2017
JS digest. Mid-Summer 2017
 
Building an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / PoseidonBuilding an artist community website with ArchGenXML / Poseidon
Building an artist community website with ArchGenXML / Poseidon
 
Silverlight 2 For Developers
Silverlight 2 For DevelopersSilverlight 2 For Developers
Silverlight 2 For Developers
 
Windows phone and azure
Windows phone and azureWindows phone and azure
Windows phone and azure
 

Más de University of West Florida (14)

Universities Without Borders
Universities Without BordersUniversities Without Borders
Universities Without Borders
 
MOOCs: Fact vs. Myth
MOOCs: Fact vs. MythMOOCs: Fact vs. Myth
MOOCs: Fact vs. Myth
 
Social Learning
Social LearningSocial Learning
Social Learning
 
Learning Verses Experience
Learning Verses ExperienceLearning Verses Experience
Learning Verses Experience
 
Social Learning Part A
Social Learning Part ASocial Learning Part A
Social Learning Part A
 
Social Communities
Social CommunitiesSocial Communities
Social Communities
 
The Social Web
The Social WebThe Social Web
The Social Web
 
Trivia/Quiz Games
Trivia/Quiz GamesTrivia/Quiz Games
Trivia/Quiz Games
 
Flash Word Games
Flash Word GamesFlash Word Games
Flash Word Games
 
Time-based Animation Games
Time-based Animation GamesTime-based Animation Games
Time-based Animation Games
 
Memory Deduction Games
Memory Deduction GamesMemory Deduction Games
Memory Deduction Games
 
Learning Game Implementation
Learning Game ImplementationLearning Game Implementation
Learning Game Implementation
 
Game Design Process
Game Design ProcessGame Design Process
Game Design Process
 
Learning Verses Experience
Learning Verses ExperienceLearning Verses Experience
Learning Verses Experience
 

Último

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Último (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Advanced ActionScript Concepts and Game Development

  • 1. Advanced ActionScript Concepts IT 7220 February 23, 2009 Sunday, February 22, 2009 1
  • 2. Agenda Syllabus Updates ✤ Game Assessment Papers ✤ Rosenzweig - ActionScript 3.0/Game Programming University ✤ Building Game Elements in ActionScript 3.0 ✤ HOT Lab - Flash Components and Forms ✤ Work in Project Teams ✤ Sunday, February 22, 2009 2
  • 3. Rosenzweig GP University Flash Game University (http://flashgameu.com/) ✤ Companion Website to Book ✤ Source code for all games referenced in text ✤ Video tutorials ✤ Blog ✤ Forums ✤ Sunday, February 22, 2009 3
  • 4. Rosenzweig Chap 1 Overview Review of Flash Interface ✤ ActionScript in timeline and using document class files ✤ Condition statements ✤ Loops - For, While, Do ✤ Use of Flash ActionScript Debugger ✤ Game Programming Checklist ✤ Sunday, February 22, 2009 4
  • 5. Simple ActionScript Program HelloWorld1.fla ✤ ActionScript in timeline, output using Trace Function ✤ Sunday, February 22, 2009 5
  • 6. Placing Objects on Stage HelloWorld2.fla ✤ Still working with ✤ ActionScript in the Timeline Create text field object ✤ Assign a value to it ✤ Place on stage (in display list) ✤ No text parameters for control ✤ Stage over placement or appearance (Display Object Container) of object Main Timeline (Display Object Container) TextField (Display Object) Sunday, February 22, 2009 6
  • 7. Document Class Library HelloWorld3.as ✤ All document classes are ✤ derived from either the MovieClip or Sprite class MovieClip class is a container ✤ class which includes the stage and timeline with each instance created This allows the text object to ✤ be added to the movie clip Document class must then be ✤ added to the Flash project file using the properties panel Sunday, February 22, 2009 7
  • 8. Rosenzweig Chap 2 Overview Creating and working with visual objects ✤ Player input ✤ Controlling animation with ActionScript ✤ Player Interaction via the Keyboard ✤ Accessing external data ✤ Arrays ✤ Sunday, February 22, 2009 8
  • 9. Visual Objects - Movie Clips We can add movie clips to our project by dragging them from the ✤ library to the stage, and then adjusting appearance using the properties panel It is also possible to add movie clips from the library solely with ✤ ActionScript, by setting the symbol linkage properties Lets take a look at the mascot movie clip in UsingMovieClips.fla ✤ The MC timeline has four layers to make it easier to change the ✤ animation a single part of the movie Sunday, February 22, 2009 9
  • 10. Create MC Objects - Flash Interface Drag as many instances of a movie clip symbol onto the stage as you ✤ want Position using select tool/properties ✤ Scale and rotate using free transform tool ✤ Sunday, February 22, 2009 10
  • 11. Create MC Objects - ActionScript First, we make the movie clip accessible to ActionScript by setting the ✤ Linkage properties (see Fig 2.2, p 43): enter Class name and select Export for ActionScript Next we use ActionScript to create a single instance on the stage at ✤ x=275, y=150, and rotating the movie clip 10º to the right Finally, using a For loop, we create 10 additional instances of the ✤ movie clip at y=300, spaced 150 pixels apart from each other, scaled at 50% of the size of the symbol class Sunday, February 22, 2009 11
  • 12. Button Creation in ActionScript Buttons can be made from either movie clips or button symbols stored ✤ in the library As we have seen, an event listener: ✤ objectName.addEventListener(MouseEvent.CLICK, objectFunction); is then used to link a button to an action Lets take a look at MakingButtons.fla ✤ Sunday, February 22, 2009 12
  • 13. Simple Shapes in ActionScript It is possible to create simple ✤ graphics entirely within ActionScript such as lines, rectangles, circles, and ellipses Closed shapes can also be filled ✤ in Lets take a look at ✤ DrawingShapes.fla Sunday, February 22, 2009 13
  • 14. Using Sprites in ActionScript The Sprite class is a basic display list building block: a display list ✤ node that can display graphics and can also contain children. A Sprite object is similar to a movie clip, but does not have a timeline. ✤ Sprite is an appropriate base class for objects that do not require timelines. For example, Sprite would be a logical base class for user interface (UI) components that typically do not use the timeline. The Sprite class is new in ActionScript 3.0. ✤ Lets take a look at CreatingSpriteGroups.fla ✤ Sunday, February 22, 2009 14
  • 15. Managing the Display List As we add objects to the display list, the last object added appears in ✤ front of previously added objects We manage the position of “children” on the stage using ✤ setChildIndex (first position is 0) Lets take a look at SettingSpriteDepth.fla ✤ Sunday, February 22, 2009 15
  • 16. User Input in ActionScript Mouse Input ✤ Use event listener to track mouse movement and rollover ✤ MouseInput.fla Keyboard Input ✤ Use event listeners to detect key press (requires ASCII codes) ✤ KeyboardInput.fla Text Input ✤ Using AS to set input type, properties and actions ✤ TextInput.fla Sunday, February 22, 2009 16
  • 17. User Interaction in ActionScript Many games allow interaction with an object using the arrow keys ✤ MovingSprites.fla Another common method of interaction is dragging an object using ✤ the mouse. The example creates an instance of the Point() class to track movement. DraggingSprites.fla Sunday, February 22, 2009 17
  • 18. Rosenzweig - Wrap-up Chapter 2 covers a lot things you can do with ActionScript for ✤ creating games Be sure to review the additional sections: ✤ Random numbers and Shuffling an Array ✤ Accessing external data ✤ Collision detection ✤ Animation examples ✤ Sunday, February 22, 2009 18
  • 19. HOT - Components and Forms You can create a form in html that includes text entry fields, check ✤ boxes, radio button, combo boxes, lists, etc. You can also set the tab order for the form elements to aid in usability. The contents of the form may then be submitted using either a form post method or by calling a script. Submitting form contents is generally via server-side script to tell ✤ what to do with the form contents. Scripts may be in JavaScript, Perl, ASP.NET, Visual Basic, or other scripting languages. Flash allows the creation of Forms, creating rich-content user ✤ applications using a set of pre-defined component classes which may be instantiated using the stage or through ActionScript. Sunday, February 22, 2009 19
  • 20. HOT - Working with Components Chap 15 builds a form in Flash using the Flash UI Components in ✤ ActionScript 3.0 Components are accessed via the Components Panel and are ✤ automatically added to the Library when they are dragged to the stage In the example, components are configured using the Properties/ ✤ Parameters panel, although this could also be done using the Component Properties panel or in ActionScript Sunday, February 22, 2009 20
  • 21. HOT - Creating a Form Take a look at: ✤ orderForm_Final.fla ✤ orderForm.fla ✤ Sunday, February 22, 2009 21
  • 22. Team Activity Begin working on storyboard ✤ What role with prototypes play? ✤ Finalize project plan ✤ Sunday, February 22, 2009 22