Aperosuz Posted January 8, 2016 Share Posted January 8, 2016 Hi everybody,I want to call a function if one group and one sprite overlap (or collide, i have try with the two but no one work ..)So i make thisgame.physics.arcade.overlap(enemyBullet(group), boat(sprite), enemyHitsPlayer(function), null, this);But when i play my game, the screen going black and say enemyHitsPlayer is not defined..i have put this line on my update() function...I work on the 2.4.3 phaser.io version. Thanks for your helpI hope you have all the information to help me Aperosuz Link to comment Share on other sites More sharing options...
drhayes Posted January 8, 2016 Share Posted January 8, 2016 How is "enemyHitsPlayer" defined? You're calling it within the "this" context... maybe you need to pass "this.enemyHitsPlayer" instead? Link to comment Share on other sites More sharing options...
Aperosuz Posted January 8, 2016 Author Share Posted January 8, 2016 Sorry i don't understand your first question, but i have remove the second part of my overlap to let onlygame.physics.arcade.overlap(enemyBullet, boat, enemyHitsPlayer);and i move the function enemyHitsPlayer just after my update function and it work. Link to comment Share on other sites More sharing options...
Recommended Posts