benny! Posted April 13, 2013 Share Posted April 13, 2013 Hi, since I do not want to spam the announcement thread - I started to post a new thread for this question. I have not tried the code myself - but just browsing through the example codes I wonder what the "collides" variable should mean: myGame.collide(car, melon, collides); I do not see where it is instantiated referring to the following code: http://gametest.mobi/phaser/collision/collide%20sprites.js So, I assume it is undefined. Nevertheless, so far I really like the whole syntax of phaser. Looks pretty clean and simple. Best,benny! Link to comment Share on other sites More sharing options...
rich Posted April 13, 2013 Share Posted April 13, 2013 It's a callback. The collides function will be called on collision and passed the 2 colliding objects. So you could do stuff like bullets vs. player and then damage the player. Link to comment Share on other sites More sharing options...
rich Posted April 13, 2013 Share Posted April 13, 2013 In the example you linked its the function that has the console.log in it. I'll do a better one soon Link to comment Share on other sites More sharing options...
benny! Posted April 13, 2013 Author Share Posted April 13, 2013 Doh... Of course. Thanks for the feedback. Link to comment Share on other sites More sharing options...
msl Posted April 14, 2013 Share Posted April 14, 2013 Hello benny! If you need collision detection library I prepared and shared on LGPL v3 license some JS library called "QuadTree JS". It's based like name is suggesting on Quad Tree algorithm. If you want to use it I can send you some code example. http://sourceforge.net/projects/quadtreejs/ Greetings! benny! 1 Link to comment Share on other sites More sharing options...
benny! Posted April 15, 2013 Author Share Posted April 15, 2013 Hey - thanks for the tipp. Much appreciated. I will have a look at it. Link to comment Share on other sites More sharing options...
Recommended Posts