Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
81
rated 0 times [  85] [ 4]  / answers: 1 / hits: 15109  / 10 Years ago, sat, september 6, 2014, 12:00:00

Just to let you know (in case someone wants to develop).



I developed a game app using Phaser.js. I sort of put the code into Ionic blank starter app. So basically the view is rendered using Ionic app and then Phaser picks up the div by the id and displays the game.



Problem:



Its a simple flappy bird clone. Its working fine but the blocks movement is a bit shaky (as though they were shivering). Since Phaser uses WebGL, could it be the reason for slow rendering or is it due to the ionic framework (/angularjs) ?



Should I have used some other tools to build the game app?



Thanks in advance.



Edit:



You can checkout the code here: https://github.com/vamshisuram/ionic-flappybird-clone.git
I uploaded all code into Git. So, I guess you can directly install platforms/ant-build/Hello-Cordova-debug.apk into your mobile and test it. Or try build again and install.


More From » html

 Answers
48

You can make it work. BUT ... there is no support for WebGL on any Android device using the stock webview (Ionic uses Cordova to package the app which is then being run inside a webview on the device): http://caniuse.com/#feat=webgl



Phaser.js is built on top of Pixie.js which will fall back to 2D canvas rendering. That's why your game is running slow.



If you want to use Ionic and WebGL you should build your app using CrossWalk. I have done that and it is awesome: https://crosswalk-project.org/



There's other options such as CocoonJS to get WebGL going, but I haven't used those myself.


[#69549] Wednesday, September 3, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madilynndiannac

Total Points: 191
Total Questions: 93
Total Answers: 111

Location: France
Member since Thu, Oct 15, 2020
4 Years ago
;