Html5 on Mobile Devices

Monkey Targets Forums/HTML5/Html5 on Mobile Devices

FelipeA(Posted 2012) [#1]
Hello,

I have a question I can't seem to find and answer for.
Has anyone made an html5 game with monkey that runs smoothly on mobile decives ( android and ios ). I am making a simple paper toss type of game and already got touch events and fullscreen ( like a webapp ) working, but performance is really poor, at least on my Samsung Galaxy S2.
Would it be wise to make the game with monkey or should I just make a new version with pure javascript from 0?

Thanks!


benmc(Posted 2012) [#2]
I just finished another game that runs fine in HTML5 on the desktop browser, but I have to use Monkey to convert it to native apps for each device, as the HTML5 version in the mobile browser seems to only run at about 30FPS when I'm looking for 60FPS.


MikeHart(Posted 2012) [#3]
Performance of mobile browser depend a lot on the company who created these browsers and the device itself.


NotSure(Posted 2012) [#4]
Give it a try

http://kstadler.ch/mobile/

they work well on the iPad at least.


MikeHart(Posted 2012) [#5]
Btw, why don't you want to develop natively for mobile?


FelipeA(Posted 2012) [#6]
@MikeHart It's for a client, I told him the benefits of native performance but he insisted on making games for mobile browsers, so it has to be html5.

@NotSure Thanks! I'll test them when I get a decent connection. Did you get the games to run on full screen on mobile devices ( no browser bars )? Right now I only got it full screen on an android phone, tested it on an ipod touch and it didn't work.

Thanks!


Leon Brown(Posted 2013) [#7]
Canvas is very slow compared to the DOM - I noticed a module in Monkey for doing DOM stuff, but there's no documentation for it. Apps would run a lot faster if they were using the DOM where relevant instead of doing everything on the canvas.


MikeHart(Posted 2013) [#8]
Leon, from what I read on the inet is that DOM is only faster when you have to draw just a few elements.


MikeHart(Posted 2013) [#9]
@Notsure: The description for 500 - ships to colonize is the same as "Galactic airport".


FelipeA(Posted 2013) [#10]
At the end I got to run it as a webapp. Runs pretty decent on iOS devices, It actually now detects the orientation of the device, if it's installed on the device and some other stuff. For android I'll just make an apk.
Thanks for the help :)


Leon Brown(Posted 2013) [#11]
Leon, from what I read on the inet is that DOM is only faster when you have to draw just a few elements.

That could be the case in some scenarios because the browser has to manage the DOM, so it depends how you have your code. If you are creating a game framework that manages objects within the game world/stage, then you'd be recoding what the DOM already is, but within Javascript and I'd assume this is slower than using the DOM as the game world/stage. If you are just drawing to the canvas without doing data management for objects, canvas might be faster in this scenario. It also depends on the browser itself too I guess.