mrphantastic Posted January 19, 2017 Share Posted January 19, 2017 I'm building out some basic games to get me a feel of Phaser. When calling the method game.physics.arcade.overlap(), it breaks my game. My game just turns into a black screen. Same thing happens if I do game.physics.arcade.collide(). This makes me assume that the reasoning is game.physics.arcade. What could be the problem? Quote Link to comment Share on other sites More sharing options...
ITpaolo Posted January 20, 2017 Share Posted January 20, 2017 Did you do this in the function: update ? Quote Link to comment Share on other sites More sharing options...
mrphantastic Posted January 20, 2017 Author Share Posted January 20, 2017 9 minutes ago, ITpaolo said: Did you do this in the function: update ? Yes I did Quote Link to comment Share on other sites More sharing options...
ITpaolo Posted January 20, 2017 Share Posted January 20, 2017 Just now, mrphantastic said: Yes I did What does the Web-Console say? Any error? Quote Link to comment Share on other sites More sharing options...
mrphantastic Posted January 20, 2017 Author Share Posted January 20, 2017 Just now, ITpaolo said: What does the Web-Console say? Any error? Where can I check this? Im using WAMP server and putting my JavaScript and HTML files in the www folder of the server. Quote Link to comment Share on other sites More sharing options...
ITpaolo Posted January 20, 2017 Share Posted January 20, 2017 Just now, mrphantastic said: Where can I check this? Im using WAMP server and putting my JavaScript and HTML files in the www folder of the server. Open your Game in the Browser and Press "F12. Then switch to Console and you should see a error. Quote Link to comment Share on other sites More sharing options...
mrphantastic Posted January 20, 2017 Author Share Posted January 20, 2017 2 hours ago, ITpaolo said: Open your Game in the Browser and Press "F12. Then switch to Console and you should see a error. I get Uncaught ReferenceError: collisionHandler is not defined But I defined collisionHandler in a later function function collisionHandler(bullet,enemy){ bullet.kill(); enemies.kill(); } Quote Link to comment Share on other sites More sharing options...
mrphantastic Posted January 20, 2017 Author Share Posted January 20, 2017 2 hours ago, ITpaolo said: Open your Game in the Browser and Press "F12. Then switch to Console and you should see a error. Actually that is the wrong error. I get this error Unable to get property 'physicsType' of undefined or null reference / phaser.js (85278,9) Quote Link to comment Share on other sites More sharing options...
ITpaolo Posted January 20, 2017 Share Posted January 20, 2017 1 hour ago, mrphantastic said: Actually that is the wrong error. I get this error Unable to get property 'physicsType' of undefined or null reference / phaser.js (85278,9) You dont have a Physic for the bullet or the enemie. e.g : enemies = this.game.add.group(); enemies.enableBody = true; enemies.physicsBodyType = Phaser.Physics.ARCADE; Try this, if it isn't working, write here. (I'm new too to Phaser, so dont judge me :D) 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.