View Source


h3.Game Maker

h5.Overview
Game maker is an application allowing users unfamiliar with programming to intuitively create games by visually organizing icons on the screen. Game Maker comes with a set of standard action libraries, covering such things as movement, basic drawing, playing music and simple control structures. Using this Game Maker a user can successfully build any game of his/her choice for eg.break out game.
h5.Game perspective
Game maker consists of two panels - Edit Panel and Game Panel. Edit panel includes all the options needed to construct any game. It lets the user creates his/her own game by choosing the images, game effects (sound, color and size) and its corresponding actions and events. Game panel displays the preview of all the images and runs the game.
h5.Playing a Game
h6.Sprites:
The user can select any sprite object from the available list of Image combo box or he/she can import sprites from the file system by clicking on select image button.
h6.Events and Action:
Once the user has selected the image, he/she can select the actions associated with each event. Here the user has many options to select a keypress event, move left or right or let the game handle it automatically (auto). For each action there is a corresponding event to indicate when the action should occur. After choosing the event and action, the user should click the select button.
The selected actions and events are shown and the user has a choice to delete the selected event by clicking on delete button. Once the event has been deleted, the corresponding action will also be removed.
h6.Game effects:
The user has a multiple choices to improve the look and feel of the game. He/she can choose size and color of the images to be drawn on stage panel. Also, he/she can play music while playing the game.
h6.Controls:
h6.Add and Save:
After selecting the desired image with its respective action and events, the user should click on the add button. A popup window will appear and will ask the user to specify the position of the image by clicking anywhere in the game panel. Save button should be clicked each time to save the current game in the xml format, before adding the next image.
h6.Load:
User can restore the previously created game by clicking on load button.
h6.Reset:
Reset button is used to clear the images on the screen and let the user start a new game.
h6.Delete:
Delete button provides an option to delete a particular image on the game panel.
h6.Start:
To start the game, simply press the start button on the game panel. This fires of the timer , which ticks periodically and alerts all the sprites to perform their respective timed actions.
h6.Stop:
To pause the game, press stop. The timer will be suspended and the sprites in the stage will cease updating themselves.
h5.Design
h6.MainModule Package:
This package contains GameMaker and MainFrame classes. MainFrame is the frame on which the GameMaker is built. GameMaker class contains the main function which executes the project.

h6.Stage Panel Package:
This is responsible for the view of the project. It displays the game created by the user and play using the control. It comprises EditPanel, GamePanel, ColorPanel, SoundPanel, ImagePanel, StagePanel classes.
EditPanel class provides an interface for editing or designing a game. It contains ImagePanel, SoundPanel, ImagePanel.
GamePanel class contains StagePanel on which the user can play the designed game and ControlPanel which has the controls for the game. StagePanel is responsible for the view of the game.

h6.Controller Package:
It controls the user specified game. It retrieves the information about the user selecting the particular option for an image, a particular action and an event. It also handles the action to be performed that was selected for an event. It has EditPanelControl, GameController and BreakGame classes.
EditPanelControl class retrieves the data from the EditPanel.
GameController class creates new sprite and sets the values of its attributes. It maintains a list of all the sprites created by the user. It controls the game by starting and stopping the timer. On every tick of the timer, the controller checks for the events and updates the sprites.
BreakGame class holds the logic for a Break Game in which collision of the sprites' and their movements are handled using Command Design Pattern. All the classes which implement the Command interface are placed in the 'commands' package.

h6.Actor Package:
It has a sprite interface and an Actor class which implements the sprite interface. This Actor class is a generalized class for all the sprites created (i.e. each object of this class has the values of the attributes associated with the actor).

h6.Event Package:
Event Package has classes for all events. Execute event class is invoked by an Actor to check all its associated events. This ExecuteEvent class executes the associated Event classes. This package uses an enum called EventType to check and execute the event classes. All the event classes invoke the ExecuteAction class to check all the actions associated with the event. ExecuteAction class is in 'actions' package. This package also contains a KeyboardSensor class which is a keyListener.
h6.Action Package:
Action package has classes for all action (every action has a class associated with it). The execute action class checks and executes the associated action classes to the invoking event. This package uses an enum called ActionType to check and execute the action.

h6.Extensibility
h6.Extending Event and Actions
• Select names for Actions and Events and add the same names as enum values in the ActionType and the EventType enum respectively.
• Create a class for the action logic in the 'actions' package.
• Write a switch case which executes the new Action class for the new ActionType.
• Create a class for the Event which calls the execute action class's 'performAction' method with the required arguments.
• Write a switch case which executes the new Event class for the new EvenType.

h6.Class diagram:
Please refer to the class diagram srcClassDiagram for more detailed understanding.
[classdiagram]>>http://fluency.knownspace.org/confluence/download/attachments/28803103/srcClassDiagram1.jpg