CSCI 1106 Sprites

Associated with the stage generated when game is

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: bers, e.g., •  Health, Lives, Score, ... •  Solu=on: Use variables to associate extrinsic proper=es with a sprite Variables •  Idea: A variable is a loca=on in the program or a sprite that stores a value •  A variable has a name by which it is referenced • A variable can be –  accessed (read) to retrieve the value it stores –  mutated (wri`en) to modify the value it stores •  Idea: The scripts associated with a sprite can access and mutate the sprite's variables Summary So Far Proper=es Sprite Name: Invader Variables 10 123 42 4 90 5 100 2 Costume1 Costume2 A Sprite's Script •  Is a sequence of blocks •  Starts on a when block •  Contains –  –  –  –  –  –  mo*on blocks control blocks sensing blocks operator blocks data blocks event blocks •  Is executed when an event occurs A Script for the Stage Sprite •  Idea: Your game will need a FRAME event –  30 =mes per second –  Allows sprites to update themselves...
View Full Document

This document was uploaded on 03/27/2014 for the course CSCI 1106 at Dalhousie.

Ask a homework question - tutors are online