Jump to content

Game Demo


Xanmia
 Share

Recommended Posts

Hey folks,

   I started working with Babylon.js about a month ago, moving from Three.js.  I am extremely happy with Babylon.js and I have learned a ton in that time mainly from the documentation and this forum.

 

   I just wanted to share my work/game so that folks on this forum can hopefully benefit from it like I did from other's posts on here.  And if you don't find it helpful hopefully you enjoy playing it!

 

   Enjoy! - http://xanmia.github.io/Light-Speed-Ready/game.html

 

   Code - https://github.com/Xanmia/Light-Speed-Ready

 

Please excuse my code messiness :)  I am moving to version 2 rewrite so I can group my code a bit better and do a lot more with in the game.

Link to comment
Share on other sites

@ Xanmia: I was looking through your code - the code for level loading and this little piece of code got me wondering:

if(engine != null){engine.dispose()}if(scene != null){scene.dispose();}

 Why do have to delete both the scene and the engine? Could you not just dispose of the scene then use

scene = new BABYLON.Scene(engine);

to create a new scene for the same engine?

 

Sorry if I am being dumb - but I am trying to learn ;-)

 

As I said above, I am using your code as a learning resource.

 

cheers, gryff :)

Link to comment
Share on other sites

You are absolutely correct, I really only need to call scene.dispose().  The engine.dispose() isn't needed.  I left it there more so as a check if it did exist somehow, I don't want it too...

Initially, I was disposing the scene on every new level. I decided that was a too "heavy" / time consuming.  That code is somewhat remnants of that.

 

Happy to help any way I can!

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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