Wednesday, March 16, 2011

Flash Game Dev Tip #5 – Configure your games in real-time

Flash Game Dev Tip #5 – Configure your games in real-time:

Flash Game Dev Tips

Tip #5 – Configure your games in real-time

How often have you been faced with the situation where-by you’ll test your game. Then need to tweak the value of one or more variables (perhaps sometimes only by a small amount) and then test the game again to see if it had the desired effect. If you are like me you’ll end up repeating this process perhaps several hundred times over the course of development.

There is an easier way – and although it won’t work for ALL genres, it could save you some precious time in the long run.

In-game variable editor

The tip is simply to build a panel into your game that allows you to edit key variables on the fly.

Here is a screen shot of such a panel in our game Chickaboom:

Chickaboom Debug Panel

The grey panel at the bottom contains controls allowing us to modify variables in real-time, such as:

  • The quantity of birds in the level
  • The speed at which they move
  • The size of them
  • The maximum size gum bubble you can blow
  • The number of birds you need to pop to complete the level
  • The amount of air with which you have to blow the gum bubbles

There is also a Text Area window and a button to restart the level with the new settings. Each time you modify something it generates AS3 source code into the TextArea, which we then cut and paste into the level data for the game.

The panel is draggable, to stop it obscuring the game, and can be hidden and displayed with a single key press.

Minimal Comps to the rescue

Creating the panel was extremely easy. Rather than mess with the complexities of Flash UI components, we turned to the ever expanding set of Minimal Components released by Keith Peters over at Bit101.

Minimal Comps comes as a source package or an SWC, and has enough documentation to get you started quickly.

Here is another debug panel, this time from a game called Kingdums (work-in-progress title!) which is being built with Flixel [...]

No comments:

Post a Comment