Build games as easily as you play them — join the Phaser Beam waitlist for Early Access.
                
            
            var sceneConfig = { preload: preload, create: create, pack: { files: [ { type: 'image', key: 'sonic', url: 'assets/sprites/sonic_havok_sanity.png' } ] } }; var gameConfig = { type: Phaser.CANVAS, parent: 'phaser-example', width: 800, height: 600, scene: sceneConfig }; var game = new Phaser.Game(gameConfig); function preload () { this.load.setBaseURL('https://cdn.phaserfiles.com/v355'); this.load.image('face', 'assets/pics/bw-face.png'); } function create () { this.add.image(400, 300, 'face'); this.add.image(400, 300, 'sonic'); }
var sceneConfig = {
    preload: preload,
    create: create,
    pack: {
        files: [
            { type: 'image', key: 'sonic', url: 'assets/sprites/sonic_havok_sanity.png' }
        ]
    }
};
var gameConfig = {
    type: Phaser.CANVAS,
    parent: 'phaser-example',
    width: 800,
    height: 600,
    scene: sceneConfig
};
var game = new Phaser.Game(gameConfig);
function preload ()
{
        this.load.setBaseURL('https://cdn.phaserfiles.com/v355');
    this.load.image('face', 'assets/pics/bw-face.png');
}
function create ()
{
    this.add.image(400, 300, 'face');
    this.add.image(400, 300, 'sonic');
}