tjs_uk Posted April 3, 2015 Share Posted April 3, 2015 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. 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.