-
Notifications
You must be signed in to change notification settings - Fork 8
Home
OPEN is a game intended for children with physical or mental disability, sensory impairment or learning difficulty. The main theme of the game is Cause & Effect – improving eye-hand coordination by clicking on different devices like switch, mouse or a touch screen. These activities help learning the linkage between cause and effect, from basic to progressive levels, by using all kinds of input devices.
OPEN is developed using Libgdx - a cross-platform game and visualization development framework. As a Libgdx project, it uses Gradle to manage dependencies, the build process, and IDE integration. Gradle is set up to use multi-project builds with the following sub-projects:
- Android
- Core
- Desktop
- iOS
With this structure, using Gradle we can write the code once (in the core sub-project) and deploy it to multiple platforms (Windows, Linux, Mac OS X, Android and iOS). However, at this time only the desktop version for Windows, Linux and Mac OS X is supported.
The core sub-project, containing the game logic, is written in Scala.
The project uses a Gradle wrapper so there is no need to install Gradle locally in order to build, run or package the project. The only requirement is to have installed Java Development Kit 7+ (JDK) and Android SDK.
In the table, you can find some of the commonly used Gradle commands. More on Gradle and Libgdx, can be found here.
| gradlew build | Build the project |
|---|---|
| gradlew desktop:run | Runs the desktop version of the game |
| gradlew desktop:dist | Packages a JAR file of the desktop game |
| gradlew desktop:launch4j | Creates an exe file from the desktop game |
| gradlew test | Runs unit tests on the core project |
| gradlew testScoverage | Executes all tests and creates Scoverage XML report with information about code coverage |
| gradlew reportScoverage | Generates test coverage reports |
| gradlew checkScoverage | Checks whether or not the unit test line and branch coverage are met |
The game’s content is structured in the following way:
-
Main menu – here the player can choose which theme to play. Currently the game has two themes, car theme and monkey theme.
-
Level 1 – Eraser game. On this level the player erases the content of the screen by simply moving the input device. After erasing 90% of the screen, the Successful Result Screen is displayed.
-
Level 2 – One click cause & effect. On this level the player should click on the game object. After a click on the object, the object moves across the scene and the Successful Result Screen is displayed on reaching the destination. If three clicks are made outside the boundaries of the object, the Unsuccessful Result Screen is displayed.
-
Level 3 – Multiple click cause & effect. On this level the player should click on the game object until it reaches its destination. Once it reaches the end, the Successful Result Screen is displayed. If three clicks are made outside the boundaries of the object, the Unsuccessful Result Screen is displayed.
-
Level 4 – Drag and drop. On this level the player should drag the game object and drop it on the end position. On successful drop at the destination, the Successful Result Screen is displayed. If three unsuccessful attempts are made, the Unsuccessful Result Screen is displayed.
-
Successful Result Screen – this screen is shown after the successful finish of any level. On the central position of this screen a happy animation of the theme object is shown, in order to enforce a positive feedback to the player. Below the happy animation, menu items are displayed for quick navigation to the main menu, re-try level, next level and next theme.
-
Unsuccessful Result Screen - this screen is shown after an unsuccessful finish of any level. On the central position of this screen an unhappy animation of the theme object is shown, in order to enforce a negative feedback to the player. Below the unhappy animation, menu items are displayed for quick navigation to the main menu, re-try level, next level and next theme.
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 the 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:
| Parameters |
|---|
| object |
| Parameters |
|---|
| object |
| Parameters |
|---|
| object |
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. |