Ionic 2 for game development? Touch input stutter


#1

Hi, I am using Ionic2 in a project now and find it absolutely brilliant for making applications for mobile platforms since it allows easy testing in a web browser as well. But I soon realized there was no limit to what one could add to an application so I quickly started dabbling with canvas and HTML5 graphics as a private little evening project.

After some hours I had some nice animation going on for a full screen canvas, and it seemed to run well/fast on my Android device as well.

But the moment i touched the screen (so I could figure out where the user clicked on the canvas) I noticed my animation stuttered. Clearly there was a lot going on when I pressed the screen that would halt my simple setInterval in javascript that was firing for every update. So clearly Ionic2 is not meant for this kind of real-time application. But at the same time I wondered why a simple touch could halt the javascript execution so much, and if there is any way I could solve it by setting up the Ionic2 project in a way that made it more responsive?

I also got stumped at getting the native library for NativeAudio to work as well (got a “plugin not loaded” error) to try out some sound effects. Perhaps not all the libraries work well in Ionic2 yet?

Are there any javascript game dev alternatives you would recommend? I know that Phaser seems to be built upon some of the same building blocks, but I am not sure how easy their deployment to Android/iOS is. One thing I absolutely love about Ionic2 is how quick it is to push out a new example to the cloud or an apk for direct transfer, but where most of the work can be done just rendering it in a browser. I know Phaser has the same advantages of quick testing in a browser, but I have no idea how convoluted deployment to a real device is. Perhaps somone here has some experience they can share?

Edit: The same stutter is experienced when running it in a web browser as well. I guess its possible to study what part of Ionic2 is gobbling up the CPU whenever a touch event happens. Perhaps its related to how it tries to find out which gesture is used?