Start implementing I/O for level data.

This commit is contained in:
Anna Rose 2023-10-06 19:42:22 -04:00
parent d9d8ce17fd
commit 25b0d8533e

View File

@ -4,13 +4,24 @@
import "CoreLibs/object"
import "entity"
local yaml = import "lib/lyaml"
local gfx <const> = playdate.graphics
local geom <const> = 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