Jump to content

What is the proper method of interacting with a babylon scene? (Making a Simon Says Game)


MasterSplinter
 Share

Recommended Posts

Okay,

 

Kind a noob question...  But, I can't seem to figure out best practices for interacting with a babylon scene.   Should I just stick all the "how the games going to work inside babylon" or should I create a separate file that interacts with babylon scene?  If the best option is later is there so good reading on how I can break up and integrate these files.

 

Here is my source so far.

 

Babylon:

https://github.com/wpdildine/Simon-Test/blob/master/simon/src/js/ui.js

 

Launcher:

https://github.com/wpdildine/Simon-Test/blob/master/simon/src/js/main.js

 

Index:

https://github.com/wpdildine/Simon-Test/blob/master/simon/src/index.html

 

 

Thanks in advance.

Link to comment
Share on other sites

Hi MS!  I'm not qualified at all on this... because I do almost exclusively all-in-one-file scenes (such as our playground demos).  But I recommend you take this...

 

http://visualiser.fr/Babylon/oldman.zip

 

Sam Girardin's ragdoll source package.  Not only is all the .ts and .js here... but Sam is a pro programmer... and you will see an organizational style to his js files/folders... that is good, in my opinion.  I think much can be learned from that package.  Sam is a nice chap and welcomes downloaders, and welcomes SOME code borrowing.  ;)  It's a great source package and a really fun demo.

 

And then there's Temechon... another fine packager and project organizer.  http://babylondoc.azurewebsites.net/page.php?p=21951  -  that will take you into his world of wonders.

 

There's many more great project managers around here, and the organization ideas that YOU have shown, seem fine, too.  The good thing... it's all flexible, and pretty easy to re-org late in the game.  JS is rather forgiving, and ascii file adjustments are easy, anytime.  It's all flexible, even 6 months into the project. 

 

One of the best organized projects of all... is Babylon.js itself.  Try to model your projects after Babylon.js, and you will always remain flexible and yet nicely organized. 

 

Sometimes, OOPies seem to rush into "locking-in" an interface and they freeze it solid, in their minds.  We try to get that step behind us, so we can get-on with fleshing it out.  Try not to lock your api's.  Let yourself flex with the JS and ascii... and when in doubt... try it ALL the different ways.  The interface to Scene (to BJS) is SO unobtrusive to JS itself, that, it's easy... and fast... and "snap-on" if you do it correctly.  Any JS object can have a single .toWebGL interface, and that's all it needs.  Your gui object(s)... maybe .toWebGL and .toHTML...  same gui... different 'view'.  *shrug*

 

There's tons of projects and demos on the Babylon.js main website, too... most of which are smartly organized/coded.  Follow the leader, MSplinter.  Others have blazed some trails and done some tests... so you might as well suck their brains dry and leave them a quivering, shivering mess  umm... utilize their knowledge.  :)  Be well.  More comments to come, surely.

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