Search the Community
Showing results for tags 'kill()'.
-
I have successfully applied the .kill() method to my bullets and enemies... the Problem is that it is registering 4 kills for each 1 enemy killed. I have been looking at this for hours and cannot figure out why it would be doing that. Any one have an idea as to why? phaserForumQuestion.js
-
Hi I am currently writing a game, but I have noticed that it is pushing the processor to the max. Previous discussions would suggest that it can be a problem with the browser, however I think I have too much going on at the same time. I have created a version of Asteroids, so as you can imagine there a lot of collisions, which from my understanding can cause the processor to work hard. My question is, I am currently using Destroy() when the asteroids are hit, would I be better off using Kill() instead? What would also be the most efficient way to recycle the asteroids? collisionHandler: function (bullet, asteroid) { //get asteroid.kill type and position var asteroidKey = asteroid.key.toString(); var asteroidX = asteroid.position.x; var asteroidY = asteroid.position.y; // When a bullet hits an asteroid we kill them both bullet.kill(); asteroid.destroy(); ... The game can be played at http://tjs_uk.bitbucket.org I intend to reduce the amount of code, now that it is working (and I have a better understanding of the Phaser... sort of??) Thanks in advance. Trev.