How to increase the performance of HTML5 game? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

How to increase the performance of HTML5 game?

I created a simple platformer on JavaScript. ES6 version: https://code.sololearn.com/WWkBJcm6X0yJ/?ref=app ES5 version: https://code.sololearn.com/WBGSFKX9P742/?ref=app Do you have any idea how to increase the performance of my game? In the cource of development, I deliberately excluded collision detections from the player's object with other game objects, as well as drawing them when they were outside the screen. I used classes, so, in contrast to my previous game, the methods of objects is on their prototype. Nevertheless, on mobile devices, the game shows a very small FPS. While on the computer - 59 FPS. I'm new so I could make a big mistake (error, bug) in my code. I will be glad to any help. Thanks. P.S. There may be bugs with the buttons in the game menu. I don't know how to fix them. Positioning problem. P.P.S Also the game goesn't work on iPad and iPhone. I don't know why.

13th Oct 2018, 7:49 PM
K137(){/**/};
K137(){/**/}; - avatar
3 Answers
+ 6
I also do not expect 60 fps on mobile, I would have at least 30 fps to achieve. ... The map can expand, you can create your own levels, new game objects can be added.
14th Oct 2018, 7:31 AM
K137(){/**/};
K137(){/**/}; - avatar
+ 2
is that whole map hard coded?
14th Oct 2018, 4:36 AM
Steve
Steve - avatar
+ 2
59 Fps is plenty, and I wouldn't expect it to be that high on a mobile device
14th Oct 2018, 4:37 AM
Steve
Steve - avatar