Jump to content

render not working with state ?


espace
 Share

Recommended Posts

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 ???

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...