-
Notifications
You must be signed in to change notification settings - Fork 8
How to contribute
The easiest way to contribute to the game, without changing the source code, is to create new game themes. Some examples of game themes would be:
- A rabbit reaching a carrot.
- A fish swimming to a coral, etc.
As long as it follows the game’s mechanics, you can easily add new themes by suppling the required graphical and audio resources.
The game is developed as an engine that runs a certain type of game themes. In regards to this, there are some constraints that all new themes should follow:
For this level, there are three required resources:
- A mask image (mask.png) that is being “erased” by the player.
- A background image (dark-background.png) that appears on the erased areas of the mask.
- Audio guidance file (audio-guidance-eraser-game.mp3) that is played on level start.
On this level, there is a theme object that will move linearly after a player’s click on it. The theme object is the car in the car theme, or the monkey in the monkey theme. Below are the required resources:
- A background image (light-background.png) on which the object moves.
- An animation file (animation-idle-object.atlas) of the object while it’s idle (before a player clicks on it). More about creating animations read here.
- An animation file (animation-moving-object.atlas) of the object while it is moving.
- Audio guidance file (audio-guidance-cause-and-effect.mp3) that is played on level start.
- Sound effect for the moving object (moving-object-sound.mp3). For example, this is a car engine sound in the car theme.
The resources for this level are the same as Level 2. The only difference with level 2 is that the object will move in a linear manner on multiple points, and will require multiple player clicks before reaching the destination.
The resources for this level are same as for Level 2, except for the audio guidance file which directs the player to drag and drop the object on the destination point. Below are the required resources:
- A background image (light-background.png) on which the object moves.
- An animation file (animation-idle-object.atlas) of the object while it’s idle (before a player clicks on it). More about creating animations read here.
- An animation file (animation-moving-object.atlas) of the object while it is moving.
- Audio guidance file (audio-guidance-drag-and-drop.mp3) that is played on level start.
- Sound effect for the moving object (moving-object-sound.mp3). For example, this is a car engine sound in the car theme.
For this screen, the below resources are needed:
- A happy animation (happy-animation.atlas) of the theme object. For example, in the monkey theme, the monkey is eating a banana.
- Audio guidance file (audio-guidance-happy-animation.mp3) giving the player a positive feedback on a job well done.
For this screen, the below resources are needed:
- An unhappy animation (unhappy-animation.atlas) of the theme object. For example, in the monkey theme, the monkey is being sad.
- Audio guidance file (audio-guidance-sad-animation.mp3) giving the player a negative feedback and encouraging him to try again.
There are three general steps for creating a new game theme:
- Create a new folder with the theme name and place it in the open\core\resources\theme\ directory.
- Add all the mentioned resources inside the folder. A summary of all theme resources can be found here.
- Update the open/core/resources/cause_and_effect.json JSON file with the new theme data. More on this here.
The open/core/resources/cause_and_effect.json file contains data about the placement of image and animation objects for each theme of the game. To add a theme, you need to add a new (theme_name, theme_data) entry in the JSON file. Below you can see the JSON file specifications:
| Structure | Type | Description |
|---|---|---|
| cause_and_effect.json | Map<String, Theme> |
A map of (theme_name, theme_data) pairs. The only constraint is that the theme name should be the same as the name of the theme folder containing the resources. |
| Structure | Type | Description |
|---|---|---|
| start_point | Point |
The start position of the theme object. |
| result_animation_point | Point |
The position of (un)happy animation object on the Action Result Screen. |
| levels | Map<String, List<Point>> |
A map of (level, list_of_stand_points) pairs containing the stand points for all 4 levels. The stand points are the places where the object stops moving after player’s click. |
| Structure | Type | Description |
|---|---|---|
| x | Integer |
position on the x-axis |
| y | Integer |
position on the y-axis |
To create animations from a batch of related images we are using Libgdx Texture Packer GUI application. The texture packer combines many small images for the animation, into a number of larger images and stores their locations so they are easily referenced by name in the game using an atlas file.
You can download the Libgdx Texture Packer GUI here. The packer is a JAR file which can be run with the following command:
java -jar texturepacker-gui.jar
To create an animation with the packer you need to have a set of images with discrete changes of the object in each image. All images should be contained in a single folder which is specified in Libgdx Texture packer as the Input directory. The Output directory should be the specific theme folder of the game project. For example: \open\core\resources\theme\your_new_theme\. The generated atlas file and all the combined images should be inside this directory.
You can find more on using the Libgdx Texture Packer here.
| Resource name | Description |
|---|---|
| animation-idle-object.atlas | An atlas file generated by the Libgdx texture packer. This is an atlas file of the idle game theme object. Together with this file, the combined animation images generated by the packer should be in the theme directory. |
| animation-moving-object.atlas | An atlas file generated by the Libgdx texture packer. This is an atlas file of the moving game theme object. Together with this file, the combined animation images generated by the packer should be in the theme directory. |
| audio-guidance-cause-and-effect.mp3 | Audio guidance for Level 2 and 3 of the game. |
| audio-guidance-drag-and-drop.mp3 | Audio guidance for Level 4 of the game. |
| audio-guidance-eraser-game.mp3 | Audio guidance for Level 1 of the game. |
| audio-guidance-happy-animation.mp3 | Audio guidance for a positive outcome of a level. |
| audio-guidance-sad-animation.mp3 | Audio guidance for a negative outcome of a level. |
| dark-background.png | A background image used on the action result screens and the eraser game (level 1). The image size should be 1440x900. |
| happy-animation.atlas | An atlas file generated by the Libgdx texture packer. This is an atlas file of the happy animation after a successful level completion. Together with this file, the combined animation images generated by the packer should be in the theme directory. |
| light-background.png | A background image used for levels 2, 3 and 4 of the game. The size of the image should be 1440x900. |
| main-menu-btn.png | This is the image appearing as a button on the main menu, representing the theme. The convention for these images is to be 256x256 in size, the image to contain a circle with theme content in it and a transparent background. |
| main-menu-btn-shadow.png | This is the image appearing as a button on the main menu, when the button is in focus. The convention for these images is to be 300x256 in size, the image to contain a circle with theme content in it, surrounded with a shadow texture and a transparent background. |
| mask.png | This is the image being erased in the eraser game (level 1). The size of the image should be 1440x900. |
| moving-object-sound.mp3 | Sound made by the moving theme object. |
| unhappy-animation.atlas | An atlas file generated by the Libgdx texture packer. This is an atlas file of the unhappy animation after an unsuccessful level completion. Together with this file, the combined animation images generated by the packer should be in the theme directory. |