Declarative API for scenes #79

Open
opened 2022-10-05 14:51:00 +02:00 by kazhnuz · 2 comments
Owner
  • Scene.def api + scene { } to handle some comment elements like gui, world, etc. Maybe it could be possible to pass a world def to handle it in an easier way ?
  • Notice that we should be able to load scene from scene file, so maybe we might add an API that allow overriding some def elements from it.

TODO:

  • List everything needed by a scene
  • List what should be able to be overrided by a file (music, etc)
  • Define API
- `Scene.def` api + `scene { }` to handle some comment elements like gui, world, etc. Maybe it could be possible to pass a world def to handle it in an easier way ? - Notice that we should be able to load scene from scene file, so maybe we might add an API that allow overriding some def elements from it. TODO: - List everything needed by a scene - List what should be able to be overrided by a file (music, etc) - Define API
kazhnuz added this to the epervier 0.8.0 (beta 1) milestone 2022-10-05 14:51:01 +02:00
kazhnuz added the
3. Need investigation
1. Feature
2. Epic
labels 2022-10-05 14:51:01 +02:00
Author
Owner

scene definition

Scene.def = {
  assets = "assets.plateform",
  music = "gameplay.level1",
  background = {type = "parallax", default="forest"},
  world = {
    type = "fake3D",
    actors = "scenes.exemple.actors",
    map = {
      type = "sti",
      default = "data.gamedata.maps.exemple.default"
    },
    gravity = {
      axis = "y",
      value = 8,
    },
  },
  screens = {
    "scenes.exemple.gui.pause",
    "scenes.exemple.gui.hud"
  }
}

scene datafile

return {
  music = "gameplay.level2",
  map = "data.gamedata.maps.level2",
  background = "forest",
  
  -- other arguments that can be used to load stuff
}
scene definition ```lua Scene.def = { assets = "assets.plateform", music = "gameplay.level1", background = {type = "parallax", default="forest"}, world = { type = "fake3D", actors = "scenes.exemple.actors", map = { type = "sti", default = "data.gamedata.maps.exemple.default" }, gravity = { axis = "y", value = 8, }, }, screens = { "scenes.exemple.gui.pause", "scenes.exemple.gui.hud" } } ``` scene datafile ```lua return { music = "gameplay.level2", map = "data.gamedata.maps.level2", background = "forest", -- other arguments that can be used to load stuff } ```
kazhnuz modified the milestone from epervier 0.8.0 (beta 1) to epervier 0.7.0 2022-11-09 09:55:47 +01:00
Author
Owner

Maybe make also the scene part of a StateMachine ?

Maybe make also the scene part of a StateMachine ?
Sign in to join this conversation.
No description provided.