DELETE THIS ACC PLS Posted August 7, 2014 Share Posted August 7, 2014 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:13EDIT : 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 More sharing options...
Dumtard Posted August 7, 2014 Share Posted August 7, 2014 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 More sharing options...
DELETE THIS ACC PLS Posted August 7, 2014 Author Share Posted August 7, 2014 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 More sharing options...
lewster32 Posted August 7, 2014 Share Posted August 7, 2014 You need to enable physics after setting box to the sprite instance, so swap lines 40 and 43 around. Link to comment Share on other sites More sharing options...
DELETE THIS ACC PLS Posted August 7, 2014 Author Share Posted August 7, 2014 Oh thanks @lewster32 fixed that. Link to comment Share on other sites More sharing options...
Recommended Posts