Jump to content

Use of Scenes / Stages needed?


fjsantosb
 Share

Recommended Posts

Hi guys,

 
I have a question / doubt in order to decide if implement Scenes (also know as Stages) on Molecule framework.
 
Do you guys think that it's neccesary the use of scenes in game logic in order to control different parts of the game in a better and orderer way (i.e: menu scene, game scene, game over scene…), or do you prefer to work only over one 'scene' and change different sprites when needed?
 
In my own opinion, it's interesting to work with scenes, but i think that maybe add a little extra complication on setting up the game (you will need to add scenes to game and add sprites to scenes).
 
What do you think?
Link to comment
Share on other sites

If used properly, scenes can save you some time and are easier to code. Otherwise you'll end up having a bunch of if() statements to determine the correct scene to render.

My animationFrame() function only makes a call to drawScene(); and by default drawScene = titleScene(); Then if the user chooses to start game drawScene = inGame(); of course you'll have to set up game variables like player start position, enemy positions etc...

animationFrame will execute whatever function is equal to drawScene() instead of having to figure out which scene to render. This also makes your code easier to read.

Note, apparently it's standard practice to separate the drawing code from the logic code. So, if you have separate logic function you can do the same thing with that.

Link to comment
Share on other sites

Hi GBebbe,

 

Molecule drawing code and logic code is currently separated; Scenes has been implemented from the beginning but I fear to add complexity to the framework and final user.

 

I am a bit obsessed right now, to keep framework simple for final user, usable and very friendly.

 

I am agree with you, for the point of view of advance programmer, that scenes help to keep the code clean (after all, you can create different scenes for menu, game or stages inside game, but I fear that for the novice programmer or fast development is not enough useful to justify).

 

I am not sure to release the scenes on the framework yet.

 

Thanks for experience / opinion.

 

Regards,

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