Question on game with complex runtime GUI on scene

I am in the process of building a game that has quite a few GUI elements as part of the game play. The game screen has the following regions:

  1. A toolbox to drag objects from. These objects are animated sprites, and, dragged and dropped during gameplay.
  2. A “play area” to drop the objects, manipulate and animate them, before going to next level.
  3. A configuration area to manipulate the properties of the objects dropped in the “play area”

The main problems I foresee are:

  1. Animated sprites are created at runtime and added to the play area DURING game play; and these objects become part of further gameplay.
  2. Support drag and drop objects (animated sprites) from one place on a scene to another place on the same scene, move, change their appearence, and resize them
  3. Runtime creation and placement (on the scene) of a lot of complex GUI objects such as:1. Check box, 2. Edit box, 3. Combo box whose contents are dynamic, 4. Label 5. Image Button 6. Radio button 7. List box 8. Html link button (9) Multiline edit box (10) Menus and submenus.
  4. When an event happens to any of these GUI elements that are created at runtime, or to a dropped object, an event should be fired that can be handled in the game code. For example, when someone selects a check box, an event should be fired with all checkbox-relevant info. In the code to handle this event, we should able to handle this checkbox click.
  5. Change the appearence of an animated sprite (making them appear “inactive”, “active”, “selected”, etc . . . )
  6. Zoom and pan of the scene using a zoom button or an zoom-area-selectin tool

Any ideas on what is the best approach/design/architecture for this game? Where should I do most of the coding/programming ? , . . . . Please ask for more information if needed.

Thanks a lot.

Hi,

My only advice is to start small. Never start working out all of those requirements. Pick one an area and then pick one thing in that area to implement and do that, writing no code for the others until the first is done at which point you can modify your first solution as needed based on other requirements.

For example, looks like a good chunk of your list is around GUI elements. Maybe start by writing some code to dynamically creating those GUI objects dynamically. This will get you thinking of how to say which elemts to make and how to handle those inputs. Then work on the message notifications. For that, I’d look into using SendMessage() (perhaps later writing a Messenger wrapper around it to optimize it as needed).

For the SendMessage you can pass it one argument. An easy answer is to make that one object a Hash table so you can add as many params to that as you like. Perhaps eventually moving it to a custom MyGUIEventArgs class once you nail down the list of arguments you’ll be passing around.

Etc, etc.

I know that’s kind of high level but hopefully that gets you focused and helps a bit.