eps Posted April 7, 2017 Share Posted April 7, 2017 Hi I'm a bit stumped with an issue - I think I may well be approaching this from the wrong way though... I am looking to make a game in which the player shoots a bullet at moving targets.. Quite simple. But the collision detection and removal of those items hit seems to go wrong for me. I've tried using a playground version of the code as well, but it performs differently to the code I have on my machine. It would be great it someone with more babylonjs experience could at least point me in the right direction and possibly also point out the bits of the code which I'm using incorrectly. Playground is here : http://www.babylonjs-playground.com/#XAACN#0 Although when using it on my machine it works a lot better - having a particle explosion and doesn't necessarily stop at the first 'hit' and for some reason within the Playground it only allows me to have 2 'bullets' whereas on my machine it has the correct number 5. What I am trying to do is produce an array (possibly my first mistake in babylonjs!) of aliens and then get the player to shoot them - the bullets are each checked to see if they have hit a target and so on... I realise some of this processing is costly - so am happy for the code or approach to be ripped apart. Cheers Quote Link to comment Share on other sites More sharing options...
eps Posted April 7, 2017 Author Share Posted April 7, 2017 Hmm.. This change seems to resolve my issues http://www.babylonjs-playground.com/index2_5.html#1GYLOL#0 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 7, 2017 Share Posted April 7, 2017 I cleaned up the PG a bit because it was a mess http://www.babylonjs-playground.com/#XAACN#3 I tried to play a bit and it seems to work for me eps 1 Quote Link to comment Share on other sites More sharing options...
eps Posted April 12, 2017 Author Share Posted April 12, 2017 Cheers, many thanks @Deltakosh ! Merci beaucoup! GameMonetize and Wingnut 2 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.