Jump to content

Cannot call method 'hasOwnProperty' of undefined


DELETE THIS ACC PLS
 Share

Recommended Posts

Hi, I followed Thomas Palef's tutorial to make a flappy bird game for learning.

It used 1.1.5 phaser, I tried to do it with 2.0.7 but had this bug, Don't know how to solve it.

Uncaught TypeError: Cannot call method 'hasOwnProperty' of undefined phaser.min.js:16b.Physics.Arcade.enableBody phaser.min.js:16b.Physics.Arcade.enable phaser.min.js:16play_state.create VM484 main.js:40b.StateManager.loadComplete phaser.min.js:7b.StateManager.preUpdate phaser.min.js:7b.Game.update phaser.min.js:9b.RequestAnimationFrame.updateRAF phaser.min.js:13window.requestAnimationFrame.forceSetTimeOut._onLoop phaser.min.js:13

EDIT : Here's what's in line 40 in main.js 

game.physics.arcade.enable(box);

Any help is appreciated, Also I'm looking for someone to help me complete the whole game. (Skype: hadzy.1)

 

Cheers,

Hady Hayman (IamHadzy)

Link to comment
Share on other sites

I believe that is saying box is undefined, make sure box is what you expect it to be.

I will also make a suggestion to not use the min version of phaser during development, that is telling you it is on line 16 which is useless, if you use the regular version you can find where the problem occurs a lot easier.

Link to comment
Share on other sites

Thanks @Dumtard .. I think box i already defined box.

Here's some codes used to define box :
 

/* line 18 */ var box;/* line 40 */ game.physics.enable(box, Phaser.Physics.ARCADE);/* line 43 */ box = game.add.sprite(400, 400, 'box');/* line 44 */ box.body.gravity.set(0, 180);

Should I make line 40 after 43 or that doesn't matter?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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