sir_smiggles
sir_smiggles

Reputation: 17

Phaser not showing anything

I am new to this framework and need help. If you have used Phaser, then perhaps you can help me with my code. The problem I am having is that when I execute my code, it shows a blank white screen. Here is my code. Should I also include the index.html?

var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });


    function preload() {

        game.load.image('sky', 'assets/sky.png');
        game.load.image('ground', 'assets/platform.png');
        game.load.image('star', 'assets/star.png');
        game.load.spritesheet('dude', 'assets/dude.png', 32, 48);

    }

    function create() {

        game.add.sprite(0, 0, 'star');

    }

    function update() {
    }

Very simple app. I have also started a Local Web server with Brackets If you wanted to know. Any help and answers would be well apppreciated. Thanks!

Upvotes: 0

Views: 1899

Answers (1)

sir_smiggles
sir_smiggles

Reputation: 17

Never mind, I have solved my "white screen" problem by using a different browser to debug the errors and this is kind of embarrassing but I mistakingly spelt jslibphaser.js instead of js/lib/phaser.js.

Upvotes: 1

Related Questions