Andrzej Mazur / @end3r / Enclave Games
Poznań, January 24th 2014
Andrzej Mazur (coding, Enclave Games)
Robert Podgórski (graphics, Blackmoon Design)
Geeksphone Keon and Peak, ZTE Open, Alcatel OneTouch Fire, LG Leo, more coming soon.
Firefox OS App Manager (Firefox 26+), Dev tools + Simulator
Firefox OS game == HTML5 game
ctx.drawImage(myImage, 0.3, 0.5);
myEntity.offscreenCanvas = document.createElement(“canvas”);
myEntity.offscreenCanvas.width = myEntity.width;
myEntity.offscreenCanvas.height = myEntity.height;
myEntity.offscreenContext = myEntity.offscreenCanvas.getContext(“2d”);
myEntity.render(myEntity.offscreenContext);
<canvas id="mycanvas" moz-opaque></canvas>
var scaleX = canvas.width / window.innerWidth;
var scaleY = canvas.height / window.innerHeight;
var scaleToFit = Math.min(scaleX, scaleY);
var scaleToCover = Math.max(scaleX, scaleY);
stage.style.transformOrigin = "0 0"; //scale from top left
stage.style.transform = "scale(" + scaleToFit + ")";
Optimize for HTML5 games, not Firefox OS
manifest.webapp
{
"name": "My App",
"description": "My description goes here",
"launch_path": "/",
"icons": {
"128": "/img/icon-128.png"
},
"developer": {
"name": "Your name or organization",
"url": "http://your-homepage-here.org"
},
"default_locale": "en"
}