Jump to content

Problem with loading image


Fahad Uddin
 Share

Recommended Posts

Hello everyone, 

i am fairly new in phaser, here i want to make my bouncing around the box. but it's not loading.

here is my code ,

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

var circle;

function preload() {

    game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
    game.scale.pageAlignHorizontally = true;
    game.scale.pageAlignVertically = true;
    game.stage.backgroundColor = '#008000';
        game.load.image('circle', 'assets/myface.png');
}
function create() {
    game.physics.startSystem(Phaser.Physics.ARCADE);
    circle = game.add.sprite(50, 50, 'circle');
    game.physics.enable(circle, Phaser.Physics.ARCADE);
    circle.body.velocity.set(150, 150);
    circle.body.collideWorldBounds = true;
    circle.body.bounce.set(1);
}

how to solve it ?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...