Scene Management

79 views
Skip to first unread message

Phil

unread,
Sep 24, 2017, 3:41:40 PM9/24/17
to excaliburjs
Hi! Got my little game working, more or less and would start implementing different levels now.

But I'm not quite sure about how to approach this. Is the idea behind the scenes to have a scene for each level, or to reuse a level and set it up differently?

For example in the Breakout clone, would you rather have n scenes for n levels or one scene with the same paddle and ball but e.g. different layouts of bricks that you'd reset/change between the levels?

Also, on a related note: Any best practices on hand-off between levels? I've been working with a Director so far that saves settings/scores between levels. Before I saved everything in a global object but that got quite ugly quickly...

Cheers

Phil


PS: in case you want to take a look - https://github.com/LePhil/ExcaliburPlayground (always happy about input from more experienced Excalibur users!)

PPS: there's no fitting tags for this question, I think...

Kamran Ayub

unread,
Sep 25, 2017, 9:28:12 PM9/25/17
to Phil, excaliburjs
Scenes can be used however you see fit. I would say it seems reasonable for a scene to have a single responsibility--i.e. a main menu, credits, a level. If a lot of actors will be the same in a scene, I'd reuse it (so like the Breakout example). The sample game I'm working on works that way, the game is "infinite" but it all happens in a single scene.

For scoring and things like that in the past we've used a Stats object and a State manager but our games so far are pretty simple.


--
You received this message because you are subscribed to the Google Groups "excaliburjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to excaliburjs...@googlegroups.com.
To post to this group, send email to excal...@googlegroups.com.
Visit this group at https://groups.google.com/group/excaliburjs.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/dc5de846-a981-4fa4-8b53-7966630bffb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Josh Edeen

unread,
Sep 25, 2017, 9:34:06 PM9/25/17
to excaliburjs
PS: You're game looks great! Looking forward to seeing it as it develops!

PPS: I can't seem to find any practical difference between "question" and "discussion" topic types, so I've added a 'question' tag to the group for future use.
Reply all
Reply to author
Forward
0 new messages