jacobgardner / hack-and-slash

Hack & Slash: Sidescroller
https://jacobgardner.github.io/hack-and-slash/
0 stars 1 forks source link

Build Scene Object #4

Closed jacobgardner closed 8 years ago

jacobgardner commented 8 years ago

The renderer should be fed a scene object which is actually what controls what's being rendered. We'll probably only have one scene type (a level), but possibly will have multiple scenes (multiple levels).

Scenes could be used for Menus, Levels, Credits, etc. Anything where the context is completely different for the renderer.

A level scene will be responsible for rendering hud elements, the background, and level entitites.

class Renderer {
  draw() {
    preDraw()
    currentScene.draw();
    postDraw();
  } 
}

We'll probably have to move some of the stuff that's currently in renderer into the scene object, like scaling the units to be 20 high. This way units n' stuff are specific to a scene type and not universal.

jacobgardner commented 8 years ago

Closing this in favor of #6. We don't need a generic scene object until we have multiple types of scenes. I'm not even sure what they would share besides the draw function.