espace Posted March 16, 2017 Report Share Posted March 16, 2017 hi, actually i use this structure. my hero is described like a body and physics works well. var level1 = { create: function(){ this.hero=new player() }, update:function(){ }, render:function(){ console.log("ok"); game.debug.body(this.hero) }, } in my console.log i see "ok" but the debug render not works my game is described like this game = new Phaser.Game(1280,1920,Phaser.CANVAS,'game' ) game.state.add('boot',bootstate) game.state.add('preload',preloadstate) game.state.add('game_first_screen',game_first_screen) game.state.add('level0',level0) game.state.add('level1',level1) game.state.add('level2',level2) game.state.add('level3',level3) game.state.add('menu_level_select',menu_level_select) game.state.add('levsel', levsel); // note: first parameter is only the name used to refer to the state game.state.start('boot',bootstate) what i'm doing wrong because i don't see my error ??? Quote Link to comment Share on other sites More sharing options...
samid737 Posted March 16, 2017 Report Share Posted March 16, 2017 are you using P2 physics? I think in P2 physics you need to explicitly state to allow the body to be rendered: hero.body.debug=true; http://phaser.io/docs/2.6.2/Phaser.Physics.P2.Body.html#debug espace 1 Quote Link to comment Share on other sites More sharing options...
espace Posted March 16, 2017 Author Report Share Posted March 16, 2017 yes i'm using p2 and problem solved samid737 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.