Skip to content

Instantly share code, notes, and snippets.

@beakr
Created December 15, 2013 03:48
Show Gist options
  • Save beakr/7968628 to your computer and use it in GitHub Desktop.
Save beakr/7968628 to your computer and use it in GitHub Desktop.
Pixi.js boilerplate.
function main()
{
// We render our game with WebGL or canvas depending on the browser automatically
// with Pixi.js in our game renderer variable.
//
// Our game is 400x400 pixels because it will be made of 25x25 tiles measuring 16x16
// pixels.
var gameRenderer = PIXI.autoDetectRenderer(400, 400);
document.body.appendChild(gameRenderer.view);
var level1 = new PIXI.Stage(0xFF0059);
var update = function()
{
requestAnimFrame(update);
gameRenderer.render(level1);
}
requestAnimFrame(update);
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment