Fahad Uddin Posted May 24, 2017 Share Posted May 24, 2017 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 More sharing options...
Contra Code Posted May 26, 2017 Share Posted May 26, 2017 This code works for me. My guesses: 1. the path to your PNG image is not correct; or 2. you are not including phaser correctly in your script tag. Link to comment Share on other sites More sharing options...
FakeWizard Posted May 26, 2017 Share Posted May 26, 2017 what can yoiu see in your console? any errors? Link to comment Share on other sites More sharing options...
Recommended Posts