My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

What is QuickTiGame2d?

QuickTiGame2d is a 2-dimensional game engine module for Titanium Mobile that provides quick and easy api to create casual 2d games on Titanium. QuickTiGame2d runs much faster on mobile devices because it is based on OpenGL ES: the industry-standard graphics library on embedded systems. Currently QuickTiGame2d supports both iOS and Android.

NEW: 05/14/2012 QuickTiGame2d 1.1 is released!

  • Add: TextSprite that can render static label text
  • Fix: MapSprite cause concurrent exception on Android
  • Fix: game.screen returns retina resolution on non-retina devices with iOS 4

Important Fix: Game View screen size was incorrect on non-retina devices

On QuickTiGame2d version 1.0 and older, game view returns invalid retina screen size especially on non-retina devices.

var quicktigame2d = require('com.googlecode.quicktigame2d');
var game = quicktigame2d.createGameView();

game.addEventListener('onload', function(e) {
    Ti.API.info(game.screen.width + "x" + game.screen.height);
});

Device version 1.0 version 1.1
iPhone, non-retina 640x960 320x480
iPhone, retina 640x960 640x960
iPad 2 and older 1024×768 1024×768
iPad 3rd 1024×768 2048×1536

NEW: 05/07/2012 QuickTiGame2d goes Open Source!!

https://github.com/infosia/quicktigame2dmodule

Important Notice: Titanium 2.0 Layout Changes

Due to layout changes on Titanium 2.0, all codes that use width and/or height directly from GameView should not work.

For example:

var quicktigame2d = require('com.googlecode.quicktigame2d');
var game = quicktigame2d.createGameView();

game.addEventListener('onload', function(e) {
  Ti.API.info("view size: " + game.width + "x" + game.height);
}

Above code works on Titanium 1.8, but it doesn't work on Titanium 2.0. This should be:

var quicktigame2d = require('com.googlecode.quicktigame2d');
var game = quicktigame2d.createGameView();

game.addEventListener('onload', function(e) {
  Ti.API.info("view size: " + game.size.width + "x" + game.size.height);
}

Add Support for Isometric and Hexagonal Tiled Map!

Check out the latest example from repository:

http://code.google.com/p/quicktigame2d/source/browse/QuickTiGame2dExample/

03/14/2012 QuickTiGame2d supports tiled map integration!

03/01/2012 QuickTiShooter: shooter game example is out!

Check out the latest source from repository:

http://code.google.com/p/quicktigame2d/source/browse/QuickTiShooter/

02/27/2012 QuickTiGame2d now supports Physics! (iOS only)

  • Add: Support for Box2d physics that is much similar to Titanium.Box2d (iOS only)
  • Add: Sprite#scaleFromCenter that scales sprite from given coordinates
  • Add: QuickTiBall, Box2d physics example (QuickTiGame port of TiBall)

Note: if you would like to use QuickTiGame2d with Box2D support, use com.googlecode.quicktigame2d-iphone-box2d-x.x.zip instead of com.googlecode.quicktigame2d-iphone-x.x.zip

02/20/2012 QuickTiGame2d supports Particles!

02/13/2012 QuickTiGame2d supports 3D perspective!

  • Add: Support for 3D viewpoint transformation
  • Add: 3D rotation of sprites
  • Add: HUD (Head Up Display) sprites that does not follow viewpoint transformation

02/06/2012 New animation function similar to Titanium.UI.Animation is out!

From version 0.2, an new object animation object Transform has been added that is equivalent for Titanium.UI.Animation in nearly. The transform object runs smoothly rather than using processing every frame by using 'enterframe' event.

var quicktigame2d = require('com.googlecode.quicktigame2d');
var transform  = quicktigame2d.createTransform();

var sprite = quicktigame2d.createSprite({image:'sprite.png'});

// move to (100, 100) in 1 second.
transform.duration = 1000;
transform.x = 100;
transform.y = 100;
trnasform.easing = quicktigame2d.ANIMATION_CURVE_EASE_IN;

sprite.transform(transform);

Check out the latest module and documentation, and the latest example.

01/31/2012 QuickTiGame2d now supports Android platform!

Check out the latest module: http://code.google.com/p/quicktigame2d/downloads/list

An addictive Whac-A-Mol like game "Kawaz-tan tataki!" is included as example of QuickTiGame2d.

Why should we use QuickTiGame2d?

Much Faster than Titanium.UI

As QuickTiGame2d is based on OpenGL ES, it renders much faster than Titanium Mobile's default UI views like Titanium.UI.ImageView.

Easy to Use

QuickTiGame2d provides easy-to-use gaming api like enchant.js and emo-framework that lets you publish your games as quickly as possible.

Support for Sprite Sheet and Animations

Support for Sprite Atlas created with TexturePacker and Zwoptex

Texture atlas definition by xml that is created with TexturePacker and Zwoptex is supported. Currently Sparrow and CEGUI/OGRE data format is supported.

Can be integrated with Titanium.UI

QuickTiGame2d can be easily integrated with Titanium.UI and other component so you can use all of components of Titanium Mobile with QuickTiGame2d. For example, you can use Titanium.UI.ProgressBar while loading your game assets like below.

cf: background image by Kawaz

What does it look like?

QuickTiGame2d provides very simple gaming api. It goes something like below.

// Obtain game module
var quicktigame2d = require('com.googlecode.quicktigame2d');

// Create view for your game.
var game = quicktigame2d.createGameView();

// Frame rate can be changed (fps can not be changed after the game is loaded)
game.fps = 30;

// Initialize your game scene
var scene = quicktigame2d.createScene();
game.pushScene(scene);

// Create your sprites and add them to the scene
var background = quicktigame2d.createSprite(
  {image:'background.png', width:640, height:960, x:0, y:0}
);

var sprite = quicktigame2d.createSprite({image:'ball.png'});

// Sprite sheet is supported
var tiles = quicktigame2d.createSpriteSheet(
  {image:'tiles.png', width:32, height:32}
);

// Add sprites to the scene
scene.add(background);
scene.add(sprite);
scene.add(tiles);

// Set sprite opacity to 50%
sprite.alpha = 0.5;

// Rotate sprite in 30 degree
sprite.rotate(30);

// Scale up the sprite by twice
sprite.scale(2);

// Z-order can be changed
background.z = 0;
sprite.z     = 1;

// Called when the game is loaded
game.addEventListener('onload', function(e) {
  Ti.API.info("your game is loaded");

  // Change position of your sprite
  sprite.x = game.screen.width  * 0.5;
  sprite.y = game.screen.height * 0.5;

  // Select first frame of sprite sheet
  tiles.frame = 0;

  // sprite sheet animation is also supported
  tiles.animate([0, 1, 2], 500);

  game.start();
}

// Called when the game enters frame
game.addEventListener('enterframe', function(e) {
  // Change position of your sprite
  sprite.x = sprite.x + 1;

  // Rotate your sprite
  sprite.rotate(sprite.angle + 6);
}

// Called when user taps screen
game.addEventListener('singletap', function(e) {
  // Note that size of our view may change due to the layout of parent view
  // so we have to take the scale into account to process touch event.
  var scale = game.screen.width / game.width;

  // Change position of your sprite
  sprite.x = e.x * scale;
  sprite.y = e.y * scale;

}

Is this engine available on Android?

NEW: 01/31/2012 QuickTiGame2d now supports Android platform!

Powered by Google Project Hosting