Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon Join the GFS Discord Server!
26. June 2014


Since LibGDX 1.1, there has been a massively improved way of creating a LibGDX project.  This document looks at how you get up and started using the setup application.


First thing you have to do is download it.  Head on over to the LibGDX download page and download Setup App.




Now that you’ve downloaded the file gdx-setup.jar, double click it and say OK to any security questions.  If it doesn’t load when you double click it, you either don’t have Java installed ( you need a JDK to work with LibGDX ) or your file extensions handling for .java files are broken.  Assuming everything worked correctly the setup app should have loaded.


Here is an example I’ve configured already:



One important thing is you need to have the Android SDK installed as well.  Google have made the process rather confusing, as their default download is bundled with Eclipse.  If you are intending to use a different IDE, the download you want is under “Download for other Platforms”, which is an extremely stupid name…  anyways, you need to have the Android SDK ( Android Build Tools version 19.1 as of time of writing, keep in mind you have to configure the Android SDK after downloading it ) installed as you have to provide the path to where you installed it.  


Otherwise it’s the usual suspects here, your project name, package and class.  Keep in mind they follow Java variable naming conventions, so for example, no spaces and mostly just alphanumeric characters.  LibGDX version allows you to choose which version of LibGDX to use, although oddly enough in every release there has only ever been the option for the most recent release.


In the Sub Projects section, you are deciding what targets you want to support.  If you aren’t on a Mac, iOS will not be an option.  


Extensions are where you configure which of the LibGDX extensions you want installed/configured.  Bullet is a physics engine, free type is a font engine, tools give you the various command line tools that are bundled with LibGDX ( I believe ), Controllers is gamepad support, Box2d is a 2D physics engine while Box2dlights is… well I have no idea what that is.


Now the part that is of critical importance is “Advanced”.  In all honest I think the “Advanced” options are far more important than the extensions.  I would actually instead suggest making the Setup app a 2 step process and make Advanced a mandatory process.  Anyways enough about my opinions, click advanced!



This is where you pick what kind of IDE you use.  For each you intend to use, tick the checkbox and it will generate the appropriate project files.  In this case I am going to be using IntelliJ IDEA, so I will tick next to IDEA.  The Maven mirror box is probably something you will never use so let’s ignore it.  Offline mode is a bit more difficult to decide.  Basically the project you create will automatically go online and figure out what dependencies your project has and make sure your project is always up to date.  If you aren’t going to have an internet connection reliably or yours is ungodly slow, you may consider ticking Offline Mode.  Otherwise you are probably best served leaving it unticked.  Now click Save.


Now back in the Setup app, click Generate:



Now the setup app will churn away for a while, downloading required files and configuring your project. If there is something wrong with your configuration, you will be warned.  On my PC using my cell connection the process took about a minute.  If successful it should look like this:



There is still some configuration to be done for running each project type in your IDE.  I have already covered that process in IntelliJ right here.  You only need to read the last half of that link.



24. June 2014



In the previous part we looked at handling graphics in Phaser, now we are going to look at handling input.  This part is going to be code heavy and fairly light on description.  Look to the code comments for more details.

As is pretty common with game frameworks, there are a number of different ways to handle input and a number of different devices, so lets get started!


Using the cursor keys and polling for input


/// <reference path="phaser.d.ts"/>

// Demonstrate the use of arrow keys in a Phaser app
// This application demonstrates creation of a Cursor and polling for input
class SimpleGame {
    game: Phaser.Game;
    jetSprite: Phaser.Sprite;
    cursors: Phaser.CursorKeys;

    constructor() { = new Phaser.Game(640, 480, Phaser.AUTO, 'content', {
            create: this.create, preload: this.preload,
        update: this.update});

    preload() {
        var loader ="jet", "jet.png");

    create() {
        var image = <Phaser.Image>"jet");
        this.jetSprite =
   / 2 - image.width / 2,
   / 2 - image.height / 2,

        // create the cursor key object
        this.cursors =;

    update() {
        // Update input state;

        // Check each of the arrow keys and move accordingly
        // If the Ctrl Key + Left or Right arrow are pressed, move at a greater rate
        if (this.cursors.down.isDown)
        if (this.cursors.up.isDown)
        if (this.cursors.left.isDown) {
            if (this.cursors.left.ctrlKey)
                this.jetSprite.position.x -= 5;
        if (this.cursors.right.isDown) {
            if (this.cursors.right.ctrlKey)
                this.jetSprite.position.x += 5;

window.onload = () => {
    var game = new SimpleGame();


When you run this code the familiar jet sprite is rendered centered to the canvas. You can then use the arrow keys to move the fighter around.  As you can see, in the state for each key is information on modifier keys like Control and Alt.  Polling for input ( that is, checking status each call to update ) is a valid way of controlling a game, but sometimes you instead want to respond to input as it arrives.  Let’s look now at an example of event driven keyboard handling:


/// <reference path="phaser.d.ts"/>

// Demonstrate keyboard input handling via callback
class SimpleGame {
    game: Phaser.Game;
    jetSprite: Phaser.Sprite;
    W: Phaser.Key;
    A: Phaser.Key;
    S: Phaser.Key;
    D: Phaser.Key;

    constructor() { = new Phaser.Game(640, 480, Phaser.AUTO, 'content', {
            create: this.create, preload: this.preload

    preload() {
        var loader ="jet", "jet.png");

    moveLeft() {
        this.jetSprite.position.add(-1, 0);
    moveRight() {
        this.jetSprite.position.add(1, 0);
    moveUp(e: KeyboardEvent) {
        // As you can see the event handler is passed an optional event KeyboardEvent
        // This contains additional information about the key, including the Control
        // key status.
        // Basically if the control key is held, we move up or down by 5 instead of 1
        if (e.ctrlKey) 
            this.jetSprite.position.add(0, -5);
            this.jetSprite.position.add(0, -1);
    moveDown(e: KeyboardEvent) {
        if (e.ctrlKey)
            this.jetSprite.position.add(0, 1);
            this.jetSprite.position.add(0, 1);

    create() {
        var image = <Phaser.Image>"jet");
        this.jetSprite =
   / 2 - image.width / 2,
   / 2 - image.height / 2,

        // Create a key for each WASD key
        this.W =;
        this.A =;
        this.S =;
        this.D =;

        // Since we are allowing the combination of CTRL+W, which is a shortcut for close window
        // we need to trap all handling of the W key and make sure it doesnt get handled by 
        // the browser.  
        // Unfortunately you can no longer capture the CTRL+W key combination in Google Chrome
        // except in "Application Mode" because apparently Google thought an unstoppable un prompted
        // key combo of death was a good idea...;

        // Wire up an event handler for each K.  The handler is a Phaser.Signal attached to the Key Object
        this.W.onDown.add(SimpleGame.prototype.moveUp, this);
        this.A.onDown.add(SimpleGame.prototype.moveLeft, this);
        this.S.onDown.add(SimpleGame.prototype.moveDown, this);
        this.D.onDown.add(SimpleGame.prototype.moveRight, this);

window.onload = () => {
    var game = new SimpleGame();


As you can see, you can also create Phaser.Key objects and attach onDown event handlers ( technically Signals ) to each.  Of course you can reuse the same handler for multiple keys.  A couple key things to notice here… unlike the previous example, holding down a key will not cause continuous movement.  You must press and release the key over and over.  If you want constant movement, either use a polling method, use and action instead of updating each frame, or add some logic to move until the key is released.


The other thing to be aware of here is the use of the CTRL+W combination and addKeyCapture().  addKeyCapture() allows you to prevent the event from bubbling up, so once you’ve handled the key combination, it’s done.  Otherwise it would keep being passed up, either to other objects in the scene, or to the browser itself.  You can also use addKeyCapture to prevent default web behavior, such as scrolling when SPACE is pressed.



23. June 2014


Thanks to a tip from a reader David I have become aware of the release for PlayStation Mobile and it’s completely free.  Here’s the details from the Unity Blog post.


Following hot on the heels of the PlayStation®Mobile (PSM) public preview, we’re proud to announce the full official release of the Unity for PSM build. Hurrah!

Tell me it’s free

Yep, the extremely good news is that, for the first time ever, anyone on the PSM Developer Program can publish their Unity content to PlayStation®Store and target PlayStation®Vita (PS Vita) completely free of charge.

There’s no dev kit; there are no fees. What’s more, the PSM build option works with both the free version of Unity and Unity Pro so developing and deploying your PS Vita game need never cost you a dime.

What do I get?

Amongst other things, the Unity for PSM build option features In-App Purchase APIs, so it’s easy to bring free-to-play content to the PlayStation®Store. Plus, you can use the Unity for PSM build option to distribute to the new entertainment system from Sony Computer Entertainment Inc. (SCE): PlayStation®TV.

If you’ve already downloaded the public preview, you’ll also notice that we’ve been busy fixing bugs, boosting performance and adding on-device script debugging.

Sounds cool, how do I get hold of it?

Download a dedicated version of the Unity engine with the PSM build option here (we’ll be integrating it in the Unity product cycle A.S.A.P.). Note that to deploy to PSM you have to register with SCE – it’s quick and simple. The PSM build option is only available for the Windows version of Unity.

How does PSM deployment differ from Unity’s PS Vita build option?

The PSM build option is designed to provide quick, simple and free access for development on a standard retail PS Vita. Unity’s existing PS Vita build option, on the other hand, gives you full native access to PS Vita and full access to PSN. As part of your PS Vita dev kit, you also get a comprehensive suite of performance and native debugging tools, Visual Studio integration and Razor CPU/GPU performance tools.

Why target PS Vita?

If you’re thinking about making the leap to console development, targeting PS Vita is a great way to familiarize yourself with PlayStation® controls and conventions. What’s more, porting your existing mobile games to PS Vita is extremely easy!


Also from Sony we heard that PlayStation Mobile SDK v 2.0 was released:



The official versions of "Unity for PSM" and "PSM SDK 2.0" are now available!
Publish your unique and innovative games and applications!

The official versions of "Unity for PSM" and "PSM SDK 2.0" are now available!
Submission of master packages deployed by the new SDKs has been enabled.

The official version of "Unity for PSM"

We have fixed bugs according to your feedback from the Public Preview to release the official version of "Unity for PSM".
Many thanks for your cooperation!

Here are the differences between the official version and the Public Preview.

  • Added functions to create and submit master packages.
  • Settings to publish PlayStation®TV compatible applications has been enabled.
  • Enabled to use "rear touch pad" feature in your games / applications.

Please refer to the FAQ Unity for PSM Overview for how to set up development environments and the development Flow.


"PSM SDK 2.0" is exclusive for PS Vita and was made based on PSM SDK 1.20. PlayStation®TV is also supported with PSM SDK 2.0.

Main differences between "PSM SDK 2.0" and "PSM SDK 1.2" are as below.

  • Enabled to use "rear touch pad" feature in your games / applications.
  • Compressed textures are available.
  • Increased available memory (resource heap memory: 96MiB, graphics memory: 96MiB).

PlayStation®TV with PSM SDK 1.2

An updated version of PSM Publishing Utility is now available for PSM SDK 1.2.
It enables you to publish PSM Applications developed by PSM SDK 1.2 to PlayStation®TV.
Download the update zip package from SDK 1.21.02 tab on the PSM SDK download page .

Please also refer to Comparison between Unity for PSM and PSM SDKs for detailed explanation of the differences.

"PSM Application Development Guidelines" have been updated

With the release of new SDKs, we have updated the "PSM Application Development Guidelines".

The major changes/modifications are as below:

  • Added requirements for PlayStation®TV support.
  • As PSM Applications developed with "Unity for PSM" and "PSM SDK 2.0" will be distributed to PS Vita store (and as optional to PS Vita TV store) exclusively, some requirements were omitted for those SDKs.
  • Some of the restrictions regarding Networking feature were removed.


I’m guessing there are a few things confusing here as the branding is getting a bit muddled at this point, I’ll try to address what I can.


First off… what’s the difference between Unity for PlayStation Mobile vs Unity for PS Vita?

Well the most obvious difference is Unity for Vita requires a PlayStation license and developer kit and gives full access to the device.  Unity for PSM on the other hand is completely free and requires only a PSM developer license ( currently free ) and will work on commercial hardware.  The limitations however I am currently unaware of.  Presumably Unity for PSM has the same hardware constraints as PSM 2.


What is the difference between PSM SDK and Unity for PlayStation Mobile?

They are completely different things.  PSM for Unity is an additional target for the Unity development environment.  PSM on the other hand is a C# based game development kit similar to XNA.


What happened to PSM for Android support?

My guess is they put a bullet in it.  The increased memory constraints is a sure sign of that.  The sad part is, it was the requirement to support ancient phones that handicapped PSM in the first place.


Can you recommend a good book for PlayStation Mobile programming?

Why yes, yes I can, one written by yours truly. :)  Of course there is a tutorial series here.  It was written for 1.0 SDK but sadly, not all that much has changed.


22. June 2014


Title kinda says it all, LibGDX 1.2 was released today.  The update includes:



I don’t think the breaking changes will impact any of our tutorial series.  Interesting to see the new AI extension, will be nice to see how that develops ( A* next? ).  Improved IntelliJ build times are certainly welcome.  You can get started here.


18. June 2014

This press release crossed my virtual desk today:

Autodesk Announces Maya LT 2015 Extension 1

Today Autodesk announced the first extension release for Maya LT 2015. The update enhances the animation experience for professional indie game makers by allowing artists to create more elaborate characters and environmental objects. The animation export tool gives artists a completely new method of exporting multiple animations per FBX file, making it easier to get animated content into a game engine, while set driven key and utility nodes help artists better control the relationships between objects in a scene.

New features include:
-- Game Exporter: simplifies how models and animations are exported from Maya LT for use in game engines, allowing artists to define their ideal export settings and have them saved the next time the file is opened. Artists can define multiple animation clips within the tool by giving each a name along with a start and stop frame.
-- Added Set Driven Key: gives artists an easier way to link animations in one scene. For example, having one character jump, while another ducks, simultaneously. Set Driven Key also improves interoperability with certain auto-rigging tools, making it easier for Maya LT users to leverage those tools to create their character rigs.
-- Rigging Utility Nodes: New utility nodes in Maya LT let artists finely tweak and adjust their character rigs and animations in the node editor, giving riggers and animators better control over character animations. The new utility nodes also make it easier for artists to use auto-generated character rigs.

The extension for Maya LT will be available today for all current monthly and perpetual customers.


MayaLT RiggingUtilityNodes 1920x1080


Remember a few weeks back Autodesk reduced the price to Maya LT from $50/month to $30/month.  As someone who has gotten used to it in Blender, the ability to create and name multiple animation in a scene is a great addition ( and long overdue ).  Frankly anything that makes rigging easier is always welcome by me.


It’s nice to see constant updates instead of annual releases, I hope this is a trend that continues.

See More Tutorials on!

Month List