🐣 Mobile Eggbert

Compile-Time Configuration

All configuration lives in two header files that are set at compile time. Runtime settings (sound on/off, zoom, accelerometer) are handled separately by GameData.

Configuration Files

FileRole
include/WindowsPhoneSpeedyBlupi/ConfigDef.hppDefines LEGACY_MODE or MODERN_MODE macro — exactly one must be active
include/WindowsPhoneSpeedyBlupi/Config.hppFPS value, TIME_SCALE, SPEED_SCALE, resolution scale enum — derived from ConfigDef
Global Impact Changes to Config.hpp affect timing, resolution, and feature flags across the entire project. Never mix LEGACY and MODERN headers in a single build.

Two Operating Modes

Exactly one mode is active at compile time. The mode is selected by defining a macro in ConfigDef.hpp.

LEGACY Mode

Faithfully reproduces original Windows Phone behaviour.

  • FPS: locked at 20
  • TIME_SCALE = 1.0
  • SPEED_SCALE = 1.0
  • Touch buttons always visible
  • No resolution scaling

MODERN Mode (default)

Experimental extended mode with higher FPS support.

  • Configurable FPS: 20, 30, 60, 90, 120, 144
  • TIME_SCALE = FPS / 20
  • SPEED_SCALE = 20 / FPS
  • Touch buttons hidden on non-touch platforms
  • Resolution scaling helpers available

FPS Settings (MODERN mode)

The target FPS is set in Config.hpp. The game logic was originally designed for 20 FPS; the scaling factors adjust physics and animation timing automatically.

FPSTIME_SCALESPEED_SCALENotes
201.01.0Original speed (same as LEGACY)
301.50.667Smooth on older hardware
603.00.333Standard modern target
904.50.222High-refresh monitors
1206.00.167120 Hz displays
1447.20.139144 Hz gaming monitors

Scaling Helper Functions

Three inline helpers in Config.hpp are used throughout the codebase to adapt timing values:

FunctionFormulaUse Case
ScaleTime(t)t × TIME_SCALEMultiply a tick count to stay proportional at higher FPS
ScaleDiv(t)t × SPEED_SCALEDivide a speed value so objects don't move faster at higher FPS
ScaleAsset(path)Inserts 4x suffixReturns path to high-DPI asset when resolution scale is 4×

Resolution Scaling (MODERN mode, experimental)

The Zoom enum controls the render resolution. Larger scales require the corresponding 4x asset directories.

Enum ValueScaleResolutionAsset directories
ScaleResolution1640×480icons/, backgrounds/
ScaleResolution21280×960future
ScaleResolution42560×1920icons4x/, backgrounds4x/
High-DPI Assets Exist Both Content/backgrounds4x/ (35 files) and Content/icons4x/ (8 files) are already present in the repository. The 4× resolution mode is functional but experimental.

Key Game Constants

Defined in include/WindowsPhoneSpeedyBlupi/Def.hpp. These are fixed regardless of mode:

ConstantValueDescription
LXIMAGE640Game viewport width in pixels
LYIMAGE480Game viewport height in pixels
MAXCELX100Maximum tile columns per world
MAXCELY100Maximum tile rows per world
DIMOBJX64Object sprite width in pixels
DIMOBJY64Object sprite height in pixels
DIMBLUPIX60Player sprite width in pixels
DIMBLUPIY60Player sprite height in pixels

Coordinate Systems

  • Tile coordinates: integer grid [0, 100) × [0, 100)
  • Game-space pixels: tile_index × DIMOBJX/DIMOBJY (64 pixels per tile)
  • Screen-space: game-space + scroll offset, managed by Pixmap via CNA SpriteBatch