A chronicle of JAN 333A, the Computer Games interim project at Wofford College, January 2009.

Friday, January 9, 2009

Today we should wrap up the first four tutorials:
  1. Your First Game
  2. Creating a Scrolling Shooter
  3. Maze Games
  4. Platform Games
If you are like me, you are tred of the tedium creating each tutorial game from scratch. [How many sprites can you load and how many objects can you define?] As you read the tutorial, look at the implementation in the example files. Tweak the example files to explore how you might do something. I think it's useful to remember what each game does so that when you work on your game, you'll know where to look to find out how to do something. For example, I remember that the maze game tutorial shows how to change the player sprite to face one of four directions.
Some questions came up yesterday that I think I found answers to:
  1. How can we get the background music to play continuously instead of starting over in each room? Start the sound in a controller_start object that is placed in the first room. [See the maze game tutorial.]
  2. Why does my character freeze in the maze game? Try disabling precise collision checking in the sprites. Make sure that the character does not stop unless it is aligned to the grid.
  3. How can I get a character to face the right direction (the direction it's moving)? Use the "Change sprite into..." action and select the subimage. Also set the speed to 0.
  4. Why doesn't the person object in the maze game have to define an event for collisions into all walls, not just for corners? Because each walls object has the corner object as a parent and so they are covered by the corner collision. When a group f objects have almost the same behaviors, consider defining one of those objects as a parent of the others. You can modify aspects of the behavior by putting an event handler in a child object that overrides the handler defined in the parent.
I have an obsrvation about collisions: It's better to put handlers for collision events between the main character and other objects in the other objects. This prevents the character from having a long list of events to handle. It also prevents the character from having to "know" about every other kind of object in the game.