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
6 Answers
-
Przemyslaw
Are there any instructions for the game? It's not at all clear how to play it.
Cheers
-
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.
-
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.
Hope this feedback helps
-
Przemyslaw,
In game.reset you have set touchEnabled: false
If you change this to true it works like a charm. -
Przemyslaw,
In game.reset you have set touchEnabled: false
If you change this to true it works like a charm. -
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);