Fla5h Posted September 26, 2013 Share Posted September 26, 2013 I cant seem to get my character to move but my animation works perfectly fine.I tried following a few of the examples but i keep getting a error. What am i doing wrong?I have used other html5 game engines but im new to phaser. here is a link to my code Link to comment Share on other sites More sharing options...
rich Posted September 26, 2013 Share Posted September 26, 2013 granny.body.velocity.x = 0; granny.body.velocity.y = 0; etc Link to comment Share on other sites More sharing options...
Fla5h Posted September 26, 2013 Author Share Posted September 26, 2013 granny.body.velocity.x = 0;granny.body.velocity.y = 0;etcnope still note working, now its saying "Uncaught TypeError: Cannot read property 'body' of undefined" here is the updated code Link to comment Share on other sites More sharing options...
rich Posted September 26, 2013 Share Posted September 26, 2013 var granny = game.add.sprite(300, 200, 'granny');Putting var here redefines it as a local variable. Remove 'var'. Fla5h 1 Link to comment Share on other sites More sharing options...
Fla5h Posted September 26, 2013 Author Share Posted September 26, 2013 yay that fixed it! thanks Link to comment Share on other sites More sharing options...
Recommended Posts