Introduction to Mobile Game Development
Written July, 2015, by Rachel J. Morris
Introduction to Mobile Game Development by Rachel J. Morris is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.moosader.com/learn/ccckc/introduction-to-mobile-game-development/.
First and foremost, you will need to download and install Gideros. You can get it here:
Download the latest version (at writing, it is 2015.06.30). The .exe file is for Windows, and the .dmg file is for Mac. If you’re running Linux, just download the .exe and make sure you install Wine as well. The files are 320 – 440 MB in size.
The Gideros suite includes several tools, such as a Font Creator, Player, Studio, and Texture Packer. We will mainly be using Gideros Studio and Gideros Player.
Gideros Studio is where we will edit our projects – add art and sound, add source code, and test run it.
Gideros Player is an application that will let you test your games without an Android or iOS emulator. If you have a mobile phone handy on the same WiFi as your computer, you can also install a Player for your phone to test quickly.
Open a test project
Let’s start by opening Gideros Studio. The main screen will look like this:
Gideros comes with a bunch of sample code, for everything from playing audio, to using your device’s accelerometer, to getting input. Let’s open a sample project to test with.
Go to File – Open Project… and open the Examples folder. This should be in the directory where Gideros is installed.
Open the Graphics folder within Examples, then the Fading Stars folder, and open Fading Stars.gproj.
In the Project Explorer pane, you will see that this Fading Stars project contains an image file (star.png) and two source code files (fade.lua and main.lua). Immediately below the Project Explorer is a preview window, so you can view images easily. To the right is the main code window.
There is a lot of sample code you can read through, but for now we just want to make sure we can test the application. First, let’s do that with the PC-based Gideros Player.
Testing on the Computer
Under the Player menu, click on Start Local Player.
It will look like this:
You can adjust settings in the player, like the screen orientation (Landscape or Portrait) and screen resolution (since many mobile devices have different resolutions).
Once the Player is up, the Play button should turn blue in the toolbar and in the Player menu.
Click on Play to test the sample program.
Testing on Mobile
To test on Mobile, you will need to install the Player on your phone. Within the directory where you installed Gideros, there should be the GiderosAndroidPlayer.apk and the GiderosiOSPlayer.zip files. See further down for more tips on installing to your phone.
Once the Player is installed on your device, running the Player will show a screen similar to the one we used on the computer.
Once it’s running on your mobile device, go to the Player menu and then Player Settings…
Set the IP address to the one being displayed on your mobile device’s screen.
Then hit the Play button. It should be uploaded to your device via the WiFi and automatically run.
On my phone, the program only took up a small portion of the screen. One of the great things about Gideros is that, it will automatically handle resizing your program to fit whatever device screen, if you want it to. Let’s fix this real quick.
Right-click on the project file Fading Stars within the Project Explorer.
From here, we can set up what the working resolution of our game is. By default, it’s 320×480 pixels. We can also set whether it runs in Portrait or Landscape mode, and how to Scale the program. I’ve set my Scale Mode to Stretch, instead of the default of No Scale – Top Left.
And I will run the program again…
Now the sample program fits my phone screen!
For the Android player, you simply need to put the .apk file on your phone or tablet and run it to install. You can do this either via USB cable, or uploading it on the web and downloading it from your phone. For example, you might email the .apk to yourself.
Your phone may need to have developer settings enabled, or you may need to set it so that you can install .apks that aren’t from the Google Play store. You will need to do a search online to find out how to do this for your version of Android running on your device.
The process of making, testing, and publishing games for iOS devices is less straightforward than for Android, because [reasons]. ¬_¬
While I have been able to get Gideros Player running on an iOS device that I borrowed from my sister, on a Mac computer I used at the local public library, I’m honestly not going to be able to support working with an iOS device too much. I’m not very familiar with the OS or the Apple devices.
But, hey, there is already some documentation on getting the Gideros Player running on iPhone: