diff --git a/src/wave.lua b/src/wave.lua index ffe2721..59aaee9 100644 --- a/src/wave.lua +++ b/src/wave.lua @@ -4,13 +4,24 @@ import "CoreLibs/object" import "entity" +local yaml = import "lib/lyaml" local gfx = playdate.graphics local geom = playdate.geometry class("Wave").extends() -function Wave.new() +-- returns a new Wave by loading in and parsing the wave data at path +function Wave.new(path) local w = Wave() + + local file = io.open(path) + if not file then return nil end + local data = yaml.load(file.read("*a")) + + for e in data.entities do + -- tk + end + return w end