Skip to main content
Space Birds supports two platforms: Desktop (LWJGL3) and Android. The game shares the same core logic across platforms with platform-specific launchers.

Platform Overview

PlatformBackendMinimum Requirements
DesktopLWJGL3Java 8+, OpenGL 2.0
AndroidAndroid BackendAndroid 5.0 (API 21+)

Desktop Platform (LWJGL3)

Lwjgl3Launcher

Main class: com.pmm.games.lwjgl3.Lwjgl3Launcher (Lwjgl3Launcher.java:8) The desktop launcher initializes the game with LWJGL3 (Lightweight Java Game Library 3) as the rendering backend.
public static void main(String[] args) {
    if (StartupHelper.startNewJvmIfRequired()) return;
    createApplication();
}

Desktop Configuration

Title
string
default:"SpaceEscape_AULA"
Window title displayed in the title bar.
Window Size
int[]
default:"[640, 480]"
Initial window dimensions in pixels. User can resize (if enabled).
VSync
boolean
default:"true"
Synchronizes frame rate with monitor refresh rate to prevent screen tearing.
FPS Limit
int
default:"refresh_rate + 1"
Limits foreground FPS to monitor refresh rate plus one. VSync provides the actual limit.
OpenGL Emulation
GLEmulation
default:"ANGLE_GLES20"
Uses ANGLE to emulate OpenGL ES 2.0 for better compatibility on Windows and macOS (especially Apple Silicon).
Window Icons
string[]
Multiple icon sizes for different contexts: 128px, 64px, 32px, 16px.

Desktop Features

Performance

  • Native performance via LWJGL3
  • Hardware-accelerated OpenGL rendering
  • Uncapped framerate possible (if VSync disabled)
  • Low resource usage

Input Methods

  • Full keyboard support
  • Mouse support (right-click to shoot)
  • Gamepad support (if implemented)
  • Precise control

Distribution

  • Single JAR file distribution
  • Platform-specific JARs reduce size
  • No installation required
  • Cross-platform compatible

Development

  • Faster build times
  • Easier debugging
  • Hot reload support
  • Direct file system access

macOS Specifics

macOS requires the JVM flag -XstartOnFirstThread for proper LWJGL3 operation. This is automatically added in the Gradle run configuration.
The StartupHelper.startNewJvmIfRequired() automatically handles this by restarting the JVM with the correct flag if needed.

Desktop Asset Loading

Assets are loaded from the assets/ directory in the project root:
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
At runtime, assets are accessed via:
Texture texture = new Texture("images/player.png");
Music music = Gdx.audio.newMusic(Gdx.files.internal("music/song.mp3"));

Android Platform

AndroidLauncher

Main class: com.pmm.games.android.AndroidLauncher (AndroidLauncher.java:10) The Android launcher initializes the game with Android-specific backend.
public class AndroidLauncher extends AndroidApplication {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
        configuration.useImmersiveMode = true;
        initialize(new SpaceEscape(), configuration);
    }
}

Android Configuration

Package Name
string
default:"com.pmm.games"
Unique identifier for the app on Google Play Store.
Compile SDK
int
default:"35"
Android API level used for compilation.
Target SDK
int
default:"35"
Highest Android version tested and supported.
Minimum SDK
int
default:"21"
Lowest Android version supported (Android 5.0 Lollipop).
Immersive Mode
boolean
default:"true"
Hides status bar and navigation bar for fullscreen experience.
Version Code
int
default:"1"
Internal version number for updates.
Version Name
string
default:"1.0"
User-visible version string.

Android Features

Touch Input

  • Native touchscreen support
  • Drag to move player
  • Tap to shoot (if implemented)
  • Multi-touch capable

Mobile Optimization

  • Adaptive resolution
  • Immersive fullscreen mode
  • Battery-efficient rendering
  • Pause on minimize

Distribution

  • Google Play Store ready
  • APK sideloading support
  • ProGuard minification
  • Multi-ABI support

Compatibility

  • Supports Android 5.0+
  • ARM and x86 architectures
  • 32-bit and 64-bit
  • Tablet compatible

Android Asset Loading

Assets are packaged into the APK from the assets/ directory:
assets.setSrcDirs(['../assets'])
At runtime, accessed the same way as desktop:
Texture texture = new Texture("images/player.png");

Native Libraries

The Android build includes native libraries for multiple ABIs:
ABIArchitectureCommon Devices
arm64-v8a64-bit ARMModern Android phones (2015+)
armeabi-v7a32-bit ARMOlder Android phones
x8632-bit IntelAndroid emulators, some tablets
x86_6464-bit IntelAndroid emulators, Chromebooks
Native libraries are automatically extracted via the copyAndroidNatives Gradle task.
Including all ABIs increases APK size but ensures compatibility. Use App Bundles on Play Store to deliver only the needed ABI to each device.

Android Permissions

The game requires no special permissions. The manifest automatically includes:
  • INTERNET permission (not used, but common for games)
  • WAKE_LOCK permission (keeps screen on during gameplay)

Platform Differences

Desktop:
  • Keyboard: Arrow keys, SPACE, ENTER, ESC
  • Mouse: Right-click to shoot
  • Precise control
Android:
  • Touch: Drag finger to move player toward touch point
  • Dead zone prevents jittery movement
  • Less precise than keyboard
  • No dedicated shoot button (shoot on cooldown removed for mobile)

Cross-Platform Code

The core game logic in the core module is 100% shared between platforms:
core/
└── src/main/java/com/pmm/games/
    ├── SpaceEscape.java       # Platform-agnostic
    ├── GameState.java          # Platform-agnostic
    └── objects/                # Platform-agnostic
        ├── Player.java
        ├── Bullet.java
        └── Obstacle.java
Only the launcher classes are platform-specific:
  • lwjgl3/src/main/java/.../Lwjgl3Launcher.java
  • android/src/main/java/.../AndroidLauncher.java
To add a new platform (like iOS, Web, or Console), only create a new launcher module. The core game code remains unchanged.

Testing on Platforms

Desktop Testing

# Run directly
./gradlew lwjgl3:run

# Test JAR
./gradlew lwjgl3:jar
java -jar lwjgl3/build/libs/SpaceEscape_AULA-1.0.jar

Android Testing

# Install and run on connected device/emulator
./gradlew android:installDebug
./gradlew android:run

# Or manually install APK
adb install android/build/outputs/apk/debug/android-debug.apk
adb shell am start -n com.pmm.games/com.pmm.games.android.AndroidLauncher

Platform Considerations

The game uses pixel coordinates, which works well for fixed-size desktop windows but can cause issues on different Android devices.Desktop: 640x480 window (configurable)Android: Varies wildly (480x800 to 1440x3200+)Recommendation: Use viewport scaling or aspect ratio calculations for production games.
Both platforms handle audio differently:Desktop: Audio continues when window loses focus (unless explicitly paused)Android: Audio should pause when app goes to background to save batteryCurrent implementation: Music is paused when switching states, but doesn’t handle Android lifecycle events.
Desktop: Can handle more objects, particles, and effects without issueAndroid: Consider:
  • Reducing max simultaneous obstacles
  • Using texture atlases
  • Limiting particle effects
  • Optimizing collision detection
  • Reducing audio quality

Build docs developers (and LLMs) love