Jump to content

Cant use this.game.debug.body(sprite);


TheGeekTechZone
 Share

Recommended Posts

each time I try running :

 

 

function render() {

game.debug.body(sprite);
}

 

the game keeps crashing this is how my code looks:

 

 

var sprite;

 

var game = new Phaser.Game(1000, 650, Phaser.CANVAS, 'Test', { preload: preload, create: eurecaClientSetup, update: update, render: render });

 

function create () {

 

game.physics.startSystem(Phaser.Physics.ARCADE);

sprite = game.add.sprite(game.world.centerX, game.world.centerY, 'bullet');
sprite.anchor.set(0.5);

game.physics.arcade.enable(sprite);

 

}

 

function render() {

game.debug.body(sprite);
}

 

what could the problem be?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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