Three small Android game templates for Code On The Go, built with libGDX. Each one creates a complete, playable game project that builds and runs on the device. They are ports of the jMonkeyEngine templates in FunandGames-jme.
| Template | Language | Game |
|---|---|---|
| Demo (libGDX) | Java | 3D Earth you drag to spin, an orbiting rocket with an exhaust trail and bloom glow, a starfield, tap for points |
| Tetris (libGDX) | Kotlin | Falling-block puzzle: drag to move, drag down to drop faster, tap to rotate, long-press to hard-drop |
| Bubble Wand (libGDX) | Kotlin | First-person shooter: catch floating balloon animals in bubbles using an on-screen D-pad and FIRE button |
All three use libGDX 1.13.1.
- Download
FunandGames-libGDX.cgtto the device's /sdcard/Download folder - Using the Add-ons manager in Preferences, install the templates
- Create a new project → pick Demo (libGDX), Tetris (libGDX) or Bubble Wand (libGDX) → name it → Create.
- Wait for "Project initialized", then tap Run.
The first build downloads libGDX from Maven Central, so it needs an internet connection; later builds use Gradle's cache.
| Game | Controls |
|---|---|
| Demo | Drag to rotate the Earth · flick to spin with inertia · tap for +10 points |
| Tetris | Drag left/right to move · drag down to soft-drop · tap to rotate · long-press to hard-drop |
| Bubble Wand | Left half: drag to walk · right half: drag to look, tap to shoot · or use the D-pad and FIRE · HIDE UI toggles the buttons |
A hardware keyboard also works (arrow keys, space, WASD).
demo/ tetris/ bubblewand/ one Code On The Go template each
template/template.json name, description and parameters shown in the IDE
app/build.gradle.peb app build script (natives unpacking, AndroidX pins)
app/src/main/java/PACKAGE_NAME/*.peb game source
gradle/libs.versions.toml.peb dependency versions
cgt/ the three templates plus templates.json, as packaged
FunandGames-libGDX.cgt zip of cgt/ — the file you install
Files ending in .peb are Pebble templates. Code On The Go fills in
${{PACKAGE_NAME}}, ${{APP_NAME}}, ${{AGP_VERSION}}, ${{KOTLIN_VERSION}}, ${{COMPILE_SDK}} and the
other tokens listed in each template.json when it creates a project.
-
Native libraries: libGDX ships
libgdx.soinside per-ABIgdx-platformclassifier jars. AcopyAndroidNativestask inapp/build.gradleunpacks them intoapp/libs/<abi>/(gitignored) before AGP merges native libraries. Builds includearmeabi-v7aandarm64-v8aonly. -
AndroidX pins: libGDX 1.13.x needs
androidx.coreat runtime. Code On The Go resolvesandroidx.*only from its offline Maven repository, which lacks some of whatandroidx.core1.13.1 pulls in. The templates therefore force versions the repository has:Module Forced version androidx.core:core1.9.0 androidx.collection:collection1.4.2 androidx.annotation:annotation1.8.1 androidx.lifecycle:lifecycle-runtime,lifecycle-common2.5.1 These match the versions Code On The Go's own AndroidX templates use.
- AGP and Kotlin versions come from the IDE (
${{AGP_VERSION}},${{KOTLIN_VERSION}}). Tested with AGP 9.3.1, Kotlin 2.3.21 and Gradle 9.6.1. - AGP 9 built-in Kotlin: the Kotlin templates don't apply
org.jetbrains.kotlin.androidin the app module (AGP 9 rejects it);jvmTargetis set throughkotlin { compilerOptions { } }. - Pebble drops the newline right after
}}. A token at the end of a line needs a trailing space (compileSdk = ${{COMPILE_SDK}}), or the next line gets joined onto it. - Don't drop to libGDX 1.12.x. It avoids AndroidX, but its
libgdx.soisn't 16 KB-page aligned, and Google Play Protect blocked the builds as harmful. libGDX 1.13.0 also usesandroidx.coreat runtime without declaring it, so it crashes on launch without the pins above.
After changing a template, copy it into cgt/ and re-zip:
(cd cgt && zip -qr -X ../FunandGames-libGDX.cgt .)cgt/templates.json lists the template folders the package contains.
All three templates were downloaded from this repo, installed, built, installed as apps and played on a Samsung tablet (SM-X238U, Android 16) with Code On The Go 26.40. Google Play Protect scanned each build as safe.