Put Out the Fire! Created for National Fire Protection Association (NFPA)

Manipulate top panel controls w/ mouse to aim water at targets.

Form

CLASSIFICATION //

Flash, web-based, supplementary

Format:

Flash SWF

Deployment:

One of three games hosted on Sparky's Firehouse, the most popular section of the NFPA's Sparky The Fire Dog website.

Components:

  • preloader.swf
  • external MP3s
  • game.swf

Language:

ActionScript 3.0

Running Time:

Completed in 25 minutes on average

Function

CLASSIFICATION //

game, ballistics

Theme:

NFPA's Sparky the Fire Dog helps kids get excited about fire safety.

Behavior:

Artillery game, similar to Worms or Scorched Earth. User sets the angle and power of a water cannon to launch a projectile at targets situated around the level. A limited amount of ammunition is given.

Mechanics:

Layered Environment Framework

I abstracted out a set of classes to handle the organization of environment objects in the game. Features include: automatically sorted layers, sorting definitions, object pool for reusing objects, command invoker, "Map" value objects accepted as environment definitions. I created this because I knew this was a feature I'd be able to use in forthcoming projects and I wanted something optimized for the Flash Authoring Tool workflow used at Powerhouse Animation.

Command Pattern

Scoring system uses commands to survey very specific interactions within the game, such as counting the number of flaming barrels, or finding the coordinates of the farthest flaming barrel from the cannon. This worked well to avoid mucking up my classes with getters or distracting verbosity.

Powerhouse Code Library

Our studio maintained a game-related source code repository. When we could abstract some of our code to produce a generally useful class, we'd contribute that to this toolkit. Code used on this project includes Box2D helper classes, camera classes for moving things within a frame, some custom datatypes, some Flash display helper classes, and an "object" package with things like reflection.

Composition Over Inheritance

To enable dynamic reconfiguration of objects at runtime, display symbols from the Flash library, Box2D physics attributes, sound objects are incorporated using composition, rather than inheritance. Game objects exist as instances of "EnvironmentObject" to work with the environment framework I created.

Project Source Code

Over 100 classes were created for this project, broken down into over 25 packages. Top-level packages: "ui", "bodies", "game", "input", and "symbols".

Box2D 2.1a

Popular 2D physics engine. Used for reusability of the game's codebase in future projects. The Flash authoring tool is used as a level editor. Flash MovieClips placed in frames contain smaller MovieClips that define vertices to be drawn by Box2D. This technique is used by any object that occupies space in the Box2D world. It allows freedom of creating concave or convex shapes, while retaining performant shapes.

StandingWave2

A low-level audio framework. Used to remedy Flash's audio lag issues and manipulate pitch and start times of sound effects based on physical force being exerted in the game.

Signals

Observer Pattern framework. Used to create decoupled, readable code.

Purpose:

Raise awareness of fire safety and let kids operate a fire truck in a simple, but challenging casual format.

Requirements:

Family-friendly game to promote fire safety, appealing to the older range of the site's users, ages 8-13.

Critique:

  • It wouldn't have been hard to take advantage of the physics engine under the hood to make objects fall naturally. It would have been worth taking a little time to do that.
  • Using StandingWave2 was a little superfluous.

Creation

CLASSIFICATION //

powerhouse-animation, team-project

Completion Date:

2011-12

Duration:

~3 months

Collaborators:

2 artists

Process:

I had already created an artillery game/restaraunt-finder called "Lunch Launch" for our studio using Box2D. As a game, its objective is to launch a ball farther than anyone had done on the high scores table. As a restaurant finder, a randomly selected destination is provided at the end of the player's turn, based on criteria selected beforehand.

I repurposed that game, removing its irrelevant features, like communication with a MySQL database, XML configuration files, a runtime-configurable world that could be customized with a large HUD panel, a high scores table, and the blitting code that was used to draw the world.

As with most projects I did at Powerhouse, I wanted the workflow to be as artist-friendly as possible to give them more creative control and minimize room for technical errors. The Flash-centric level editor allowed artists to make the levels, themselves. The layered environment framework I wrote was designed to work with objects placed on Flash's stage, accounting for the order of availability on the Display List and other quirks that come with using Display Objects placed with the authoring tool.

Tools:

IntelliJ IDEA, Adobe Flash Professional CS5.5, Adobe Photoshop CS2, Sony Sound Forge 8.0, Adobe Audition 3.0

Challenges:

  • There were a number of Box2D-related errors that required me to educate myself on some of its inner workings.
  • The object pool I had created for myself caused some confusing errors.
  • I overused the Observer pattern, which made debugging a little confusing.