Demonstration Tutorial on using the awesome LibGDX game platform with the Spriter Runtime.
Produce a multi-platform game using powerful Spriter 2D animations, that run on Android, Desktop, HTML and iOS.
For most of us, writing good software is about standing on the shoulders of giants. This demonstration is to showcase the work of others and allow programmers new to the wonders of LibGDX, Spriter, and 2D animation to get a running-start in writing cool 2D games of their own.
The code in this demonstration includes work from:
- LibGDX by Badlogic Games.
- A fast, intuitive, multi-platform game development framework. more...
- Spriter by BrashMonkey.
- An easy to use, feature rich, 2D timeline / skeletal animation editor. more...
- Spriter Runtime by Heinrich Reich and Discobeard.
- A generic Java importer / runtime for Spriter animation files. more...
The knowledge to put this demonstration together includes work from:
List of the Applications / Frameworks used in this feature demonstration.
- Android SDK Tools
- SDK Tools is a downloadable component for the Android SDK. It includes the complete set of development and debugging tools for the Android SDK.
- You only need the SDK, not the full Android Studio. Install the latest stable platforms via the SDK Manager.
- Tested with installer_r24.4.1-windows.exe
- Android Developer Tools for Eclipse (ADT Plugin)
- Android Development Tools (ADT) is a plugin for the Eclipse IDE that extends the capabilities of Eclipse to develop Android projects ...
- Eclipse update site: https://dl-ssl.google.com/android/eclipse/
- Tested with ADT 23.0.7 (August 2015)
- Android USB Device / ADB driver
- Android USB / ADB Device driver from your device manufacturer.
- Eclipse IDE for JAVA Developers
- The essential tools for any Java developer, including a Java IDE, Git client, Gradle and Maven integration
- Tested with Eclipse IDE for Java Developers - Juno SR2, Windows 32-bit.
- Gradle Tooling for Eclipse
- Gradle Tooling for Eclipse brings you developer tooling for Gradle into Eclipse.
- Eclipse update site: http://dist.springsource.com/release/TOOLS/gradle (for Eclipse < 4.4)
- Tested with Gradle IDE 3.7.2
- Java Development Kit (JDK) 7+
- Tested with Java SE Development Kit 8u73
- (JDK 6 will not work!)
- Desktop/Android/BlackBerry/iOS/HTML5 Java game development framework
- Gradle setup application, used to create the project gradle environment with LibGDX dependencies.
- Tested with LibGDX gdx-setup.jar nightly\dist (17-Feb-2016)
- The Spriter IDE - create animations using key-frames constructed from small, re-useable images (such as body parts) and animating the body parts using bones and . This method of animating offers many benefits for several aspects of a game's development and for the finished product.
- Spriter Runtime
- Tortoise GIT Client
- TortoiseGit is a Windows Shell Interface to Git and based on TortoiseSVN.
This is a 'clean-sheet' guide for getting you started from having zero applications installed to having a 2D animated game demonstration fully running on your Desktop and Android device.
Setup the Developer Environment
- See LibGDX Wiki - Setting up your Development Environment for full instructions
- Configure Android SDK Packages (using Android SDK Manager)
- Add Android SDK Build Tools 23.0.1
- Add Android SDK Platform Tools
- Add Android SDK Platform (API 20)
- Optional: Add Android System Image (for Emulator)
- Install Android Device USB Drivers
- Install Tortoise GIT Client
Setup Game Project Workspace
LibGDX provides an executable gdx-setup.jar for creating an initial Eclipse workspace that includes Android, Desktop, Html, iOS and Core projects, with LibGDX dependencies. This setup uses Gradle build files to integrate the project workspace into Eclipse (or your IDE of choice).
For this demonstration, just clone the Git project to a folder on your computer.
- Clone libgdx-spriter-demo to your computer.
- Use Tortoise Git to clone https://github.com/blueacorn/libgdx-spriter-demo to your computer.
- Fetch libgdx-spriter-demo submodules
- Use Tortoise Git to perform Submodule Update on your cloned copy
When you come to create your own game project, you will want to create a new workspace; with your own package and game file names:
- Create LibGDX Project workspace - see LibGDX - Wiki - Project Setup Gradle for full instructions
- Run gdx-setup.jar to create a new game project workspace
- Create a 'spriter' project in the root workspace
- Use Tortoise Git to add Spriter Runtime submodule:
- Repository: https://github.com/trixt0r/spriter
- To Path: your-new-workspace\spriter\libs
- Copy in 'spriter' project and src files:
- From: https://github.com/blueacorn/libgdx-spriter-demo/tree/master/spriter
- To: your-new-workspace\spriter
- Edit workspace 'build.gradle' file to add 'spriter' project dependencies
- See: https://github.com/blueacorn/libgdx-spriter-demo/blob/master/build.gradle
- Edit:<your-new-workspace\build.gradle> to add in 'spriter' dependencies
Open Workspace in Eclipse
Now that you have your Workspace setup it's time to open it in Eclipse, and build!
- Import Workspace into Eclipse - See Eclipse and Grade - Importing for full details
- Choose File -> Import
- Select Gradle -> Gradle project, Next
- Browse to your-new-workspace, Click Build Model
- Select all Projects, click Finish
- Wait for Gradle for Eclipse plugin to download all other project dependencies
Run as Desktop Application
- In Eclipse, select the 'demo-desktop' project
- Choose Run > Run
- Choose Java Application
- Choose 'DesktopLauncher' as the main application, click 'OK' to run
- The Demo Game will now build and run as a Java application on your Desktop
- Click the 'X' button to close the game
###Run as Android Device Application
- Ensure you have installed the Android USB / ADB drivers for your device
- Enable your phone for USB Debugging, Unknown Sources
- Wait for the drivers to install and the phone to be recognised
- In Eclipse, select the 'demo-android' project
- Choose Run > Run
- Choose Android Application
- Eclipse should choose the default android application
- Click Yes to Auto-monitor LogCat (debugging console)
- Ensure your phone is unlocked
- The Demo Game will now build and run as an Android application on your Android Device.