Heppell08 Posted January 27, 2014 Share Posted January 27, 2014 Is there a general way to execute a single item from a group? I've tried a few ways and still having issues with masses of bullets creating and not properly killing on contact. I've since fixed them non killing but need the bullet to only come as 1 at a time and not a spam of then. I've got the function created for shooting. Just need single items released and not masses of them. Thanks Link to comment Share on other sites More sharing options...
Alvin Posted January 28, 2014 Share Posted January 28, 2014 Have a look at the invader game example, this should solve your problem :http://gametest.mobi/phaser/examples/_site/view_full.html?d=games&f=invaders.js&t=invaders Link to comment Share on other sites More sharing options...
Heppell08 Posted January 28, 2014 Author Share Posted January 28, 2014 Yeah I fixed it eventually. What I over looked was I copied my addKey code for pausing game to create the key but I set up a function with onDown; That's why it was spamming so I removed the function and ondown code and instead replaced with if(game.input.keyboard(Phaser.Keyboard.X).justPressed) { // bullet stuff here } That's the syntax off the top of my head but that's what I needed to change. Thank you for the response Link to comment Share on other sites More sharing options...
Recommended Posts