Jump to content

First attempt at a bit of babylonjs coding...


Recommended Posts


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.




Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...