Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Slow games

Hi,

I've made 2 versions of the same game, one using Titanium.UI components and other using plain JS and running in Titanium.UI.WebView (you can run game.html file in your browser as well).

Both versions are very slow on the Phone. Check it out. Mayby someone could tell me how to make them run fast with Titanium ?
Is there any way to create smooth games on Titanium?

Here's the link to source.
http://enbo.pl/titanium/neighbour-smash.zip

— asked December 3rd 2010 by Przemyslaw Kopec
  • game
  • js
  • performance
  • slow
0 Comments

6 Answers

  • Przemyslaw

    Are there any instructions for the game? It's not at all clear how to play it.

    Cheers

    — answered December 3rd 2010 by Paul Dowsett
    permalink
    0 Comments
  • It's simple block game where you gain points by destroying blocks of same type (number). More blocks at once = more points.
    First click on the block to select it and all it's neighbours with the same type (number) then click it again to destroy selection and gain points.

    I'm testing it with Android 2.1 running on Samsung Galaxy I5700.

    — answered December 4th 2010 by Przemyslaw Kopec
    permalink
    0 Comments
  • I have tried it using 1.4.X and 1.5.X and I don't think it works properly for me.

    Despite which icons in the grid I click (all of the same type), the very top-left icon disappears. From then on, regardless of where I click, nothing happens.

    This is a screenshot.

    screenshot1

    Hope this feedback helps

    — answered December 4th 2010 by Paul Dowsett
    permalink
    0 Comments
  • Przemyslaw,

    In game.reset you have set touchEnabled: false
    If you change this to true it works like a charm.

    — answered May 10th 2011 by Gino Bruijn
    permalink
    0 Comments
  • Przemyslaw,

    In game.reset you have set touchEnabled: false
    If you change this to true it works like a charm.

    — answered May 10th 2011 by Gino Bruijn
    permalink
    0 Comments
  • Przemyslaw,

    In game.reset you have set touchEnabled: false
    If you change this to true it works like a charm.

    I also had to change to menu creation to the new way:

    var activity  = Titanium.Android.currentActivity;
    
    activity.onCreateOptionsMenu = function(e) {
        var menu = e.menu;
        var menuItem = menu.add({ title: "New Game" });
        menuItem.addEventListener("click", function(e) {
            Ti.API.debug("I was clicked");
            game.reset();
        });
    };
    

    where you had:

    var menu = Titanium.UI.Android.OptionMenu.createMenu();
    var itemNewGame = Titanium.UI.Android.OptionMenu.createMenuItem({
        title : 'New game',
    });
    itemNewGame.addEventListener('click', function(){
        game.reset();
    });
    menu.add(itemNewGame);
    Titanium.UI.Android.OptionMenu.setMenu(menu);
    
    — answered May 10th 2011 by Gino Bruijn
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.