8. was born
An Open Source JavaScript HTML5
Game Engine
Handles scenes, actors, hierarchy, input, screen resolutions, audio, physics,
complex animations, ...
Renders using canvas, CSS or WebGL.
10. What about mobile ?
First try...
...disappointing
• Poor overall performance .
• Some APIs missing or not working
• Can’t compete with native
• Lack of monetization channels (ads, IAPs, ...)
• Missing expected services === not a good user experience
11. So, what can we do now?
First GET ANGRY!
,
Then
,
drop the project, try to solve the problem.
or
12. was born
Took a plain JSVM and added all the HTML5 APIs we
identified to be necessary to develop a canvas based
game, plus some specific extension APIs for the
things that are missing in the standard.
13. was born
In fact, we added it to our C/C++ native application
development framework as a new service.
CAAT and CocoonJS are a
perfect match.
14. Challenges of game
development on mobile
Change “the web developer” way of thinking
Sorry, a mobile device is not a
desktop computer or a laptop!
15. Challenges of game
development on mobile
Smart memory management
16. Challenges of game
development on mobile
Power of two friendly images + texture packing
•Decreases memory waste
•Decreases context changes === improves performance
2048
2048
17. Challenges of game
development on mobile
Optimize your JavaScript more than ever
18. Challenges of game
development on mobile
Closures and complex JavaScript hierarchies...
...can be EVIL!
19. Challenges of game
development on mobile
Control garbage collection
20. Challenges of game
development on mobile
K!
var image = new Image();
EA
image.src = “PATH_TO_YOUR_IMAGE”;
image.onload = function(e) {
L
console.log(“Image: “ + image.width + “x” + image.height);
};
This ain’t good ;)
var image = new Image();
image.src = “PATH_TO_YOUR_IMAGE”;
image.onload = function(e) {
console.log(“Image: “ + e.target.width + “x” + e.target.height);
};
This is better.
21. Challenges of game
development on mobile
Abstraction is key
• from input
• from screen
resolution
• from rendering
“be agnostic my friend”
22. Challenges of game
development on mobile
Native features are REALLY important
• In-app payments
• Advertisement
• Push notifications
• Social network integration
• Analytics
23. Challenges of game
development on mobile
CocoonJS.Ad.preloadBanner();
CocoonJS.Ad.preloadFullScreen();
CocoonJS.Ad.onBannerShown.addEventListener(function() {
console.log("onBannerShown");
});
CocoonJS.Ad.onFullScreenShown.addEventListener(function() {
console.log("onFullScreenShown");
});
CocoonJS.Ad.onFullScreenHidden.addEventListener(function() {
console.log("onFullScreenHidden");
});
CocoonJS.Ad.setBannerLayout(CocoonJS.Ad.BannerLayout.BOTTOM_CENTER);
CocoonJS.Ad.showBanner();
CocoonJS.Ad.hideBanner();
CocoonJS.Ad.showFullScreen();
24. Challenges of game
development on mobile
Develop and test on mobile FIRST!
25. So, is ready for gaming?
Desktop Mobile
Using hybrid
YES solutions,
YES
26. So, is ready for gaming?
• We start to be legion (in 4 months of activity)
• 2275 registered developers.
• 1035 ongoing projects
• 72 games published in Google Play
• 34 games published in the App Store