Review
This presentation is the property of its rightful owner.
Sponsored Links
1 / 9

Review! PowerPoint PPT Presentation


  • 119 Views
  • Uploaded on
  • Presentation posted in: General

Review!. This is for your test, so pay attention!. Whats a variable?. A spot in memory to store information Can be numbers, strings etc You have to declare them in order to use them ( ie you have to give your variable a name before you can use it. Whats a declaration?.

Download Presentation

Review!

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Review

Review!

This is for your test, so pay attention!


Whats a variable

Whats a variable?

  • A spot in memory to store information

  • Can be numbers, strings etc

  • You have to declare them in order to use them (ie you have to give your variable a name before you can use it.


Whats a declaration

Whats a declaration?

  • Tells the computer to reserve a memory spot, and to give that spot a name. Example: var name1:string;

  • The variables name is name1, and it is a string variable that stores words.


Whats a function

Whats a function?

  • Also called a “method”

  • It’s a mini program that usually gets run many times

  • Using functions generally saves on space so you don’t have to copy and paste the same code over and over.

  • We use them most with listeners.


Whats a listener

Whats a Listener?

  • A program built into flash that runs in the background while your game is running.

  • They wait for a specific event to happen (like a mouse click) and run a small mini program (a function) every time the event happens.

  • Most objects in your game will use these listeners (aka event handlers)


Whats an object

Whats an Object?

  • A specific instance of a general type

  • Example: You can have type: Baseball (its not an actual baseball, just the definition of a baseball)

  • Now if we make several baseballs and number them 1 through 5

  • We get 5 Objects of type baseball

  • To do anything with one of the baseballs, we need to call each ball by name, baseball1.doStuff(); etc


What are properties

What are Properties?

  • Every Object in flash has what we call properties

  • Example: baseball1.x is the x coordinate of the baseball

  • baseball1.alpha is the transparency of the baseball1


Last of all

Last of all…

  • Watch your capital vs lower case letters, they are completely different things to a computer

  • Don’t give your variable names spaces in them, and definitely don’t use weird characters like (- + * etc)


Review assignment

Review Assignment

  • Make 4 narrow boxes that make up a border around the screen

  • Make a zombie you can drag (see Activity 5 for the code)

  • Setup hitTests for the zombie, so that if it touches any of the boxes, the zombie moves back to the middle of the screen


  • Login