Site hosted by Angelfire.com: Build your free website today!

Chapter 8 Worksheet

Luis Espinoza Object-Oriented Game Design (Chapter 8) Worksheet Flash Game Development

1.Differentiate between object-oriented programming and procedural programming. In object-oriented programming, the objects are at the center of the program. All of the objects in the game are programmed in their own separate class. Also, a special manager class is used to manage and control the how each of the objects acts. You think about classes and reusable code. In procedural programming, all of the programming is done inside the Main class so the Main class automatically and the SMF file run at the same time. A procedural program is made up of methods in which each method performs a certain function or solves a certain problem, and all the methods work together to build the program. This type of programming is a fast, easy, and convenient way to write small programs. What is the advantage for using object-oriented programming in Flash Game Development? Object-oriented programming is better because it saves you more time in the end.

2.How do you bind a class to a symbol? You create a new class by simply creating a new Actionscript file. You give the name of the class that you want to link to the new symbol in the Class field with the extension .as. The Class field will automatically have the symbol name as the class name. When you use an instance of that symbol in your game, Flash will look for the name you had in the Class field, and it will automatically and invisibly load the class file to the new symbol.

3.What is the difference between a property and a method? A property is just another name that describes what the object is by its physical characteristics. A method is the name or behavior that describes how a function acts.

4.Describe the uses of private vs. public properties and methods. Private methods are methods which can only be used within the class they're defined. Public methods are methods that you can access by any other classes.

5. Why would you use a name such as _studying as a property name? Using an underscore before the name of the property allows you to know which properties are private. This will prevent you from directly changing the properties of the other classes.

6. What is a getter and a setter? Get methods use the get keyword. Set methods use the set keyword and are used to get information from another object.

Play the Dungeon Maze Adventure Game in chapter 8. As you are playing the game, think about how you might create a maze game.

1.What objects would you have in your game? Scoring mechanism, a potion or something to increase the enery meter, more enemies in later levels.

2.What would your initial level look like? I just made a basic layout of the maze with the enemies, and I added the apple to give the player more energy when the guy gets it.

3.What would subsequent levels look like?

4.How would your game play advance you to the next level? When you get the key, you unlock the first door, and then use the stars or the key to defeat the enemies.

5.What would be the challenges in your first game level? The main challenge is to get the key, without getting killed by the enemies, and get to the goal. I tried to make it so the first level is not too difficult, and if the player gets the apple, the guy will get more energy, and the energy meter will increase.

6.How would you keep score?

7.How would you animate your objects? I used a motion tween by using the timeline to change the path of the enemies a little bit.

8.How would you allow player control of objects?

9.What classes would you have in your game?

10.How would you incorporate sound? A way to turn off the background music, in-game sound effects might be good.

11.How would you give the player help/instructions/feedback/status, etc.

If you can’t come up with your own idea for a maze adventure game, analyze the Dungeon Maze Adventure Game’s code to see how each of the above topics are implemented. (e.i. study the code to see how it works). Try creating a Maze game of your own or modify the Dungeon Maze to do something new.