r/TitaniumSDK

ti.game - 2D Sprite Game Engine for Titanium SDK
▲ 12 r/TitaniumSDK+2 crossposts

ti.game - 2D Sprite Game Engine for Titanium SDK

What started as a little AI test for Android sprite animations turned into a full Android + iOS Titanium SDK module for a 2D Sprite Game Engine: ti.game.

It's open-source and available at https://github.com/m1ga/ti.game and current only a preview binary because things might still change before version 1.0.0.

Current features include:

  • Sprite sheets (grid or TexturePacker atlas), frame animations, tweens
  • Touch: tap, press, drag & drop, pinch-to-scale, two-finger rotate
  • Physics: velocity + gravity, platformer solids, bouncing (restitution), arcade car model with drifting + skid marks, Newtonian flight (thrust)
  • Collision groups with events, invisible trigger zones, hitbox tuning
  • Parallax scroll looping, screen wrapping, idle wobble animation
  • Sound: low-latency overlapping effects + looping music (createSound), auto-paused and resumed with the app
  • Particles: native pooled emitters (createEmitter) — continuous rate or bursts, follow a sprite, tint/scale/fade over lifetime
  • Verlet ropes (createRope) — pin ends to sprites or points, swings natively (chains, capes, bridges, grappling hooks)
  • Fullscreen camera effects (cameraEffect) — tint and glitch shader passes over the whole rendered scene; sprite glow highlights (glowColor/glowBlur), per-sprite color tinting (tintColor), damage flashes (flash()) and additive blending (blend: 'add')
  • 18 example games in example/ covering every feature

Titanium SDK is a cross-platform mobile development framework using JavaScript and gives you all the benefits of an app framework like windows, UI elements, network functions, list, tables,... everything a normal business app has including many modules for Ads, Maps etc.

ti.game allows you to build simple 2D games right inside the framework! It's still in the early development phase but the demos include:

flappy pigs, a platformer, card game and asteroids clone

and more (side scroller, puzzle, particle demo,...). This small tutorial will show you the syntax and how to set it up: https://github.com/m1ga/ti.game/blob/main/tutorial.md

Adding a player character is as easy as:

let sheet = Game.createSpriteSheet({
  image: 'adventurer.png',
  frameWidth: 32,
  frameHeight: 48,
  smoothing: false,   // nearest-neighbor — keeps pixel art crisp
  animations: {
   idle: { frames: [0], fps: 1, loop: true },
   walk: { frames: [1, 2], fps: 6, loop: true }
  }
});

let hero = Game.createSprite({
  sheet: sheet,
  width: 96,
  height: 144
});
gameView.add(hero);
hero.play('idle');

So check out the module at https://github.com/m1ga/ti.game and if you are new to Titanium SDK you can look at https://titaniumsdk.com/ or https://fromzerotoapp.com/ for some tutorials and setup guides.

Code strong!

u/_miga_ — 2 days ago