Start implementing I/O for level data.
This commit is contained in:
parent
d9d8ce17fd
commit
25b0d8533e
13
src/wave.lua
13
src/wave.lua
|
@ -4,13 +4,24 @@
|
||||||
import "CoreLibs/object"
|
import "CoreLibs/object"
|
||||||
import "entity"
|
import "entity"
|
||||||
|
|
||||||
|
local yaml = import "lib/lyaml"
|
||||||
local gfx <const> = playdate.graphics
|
local gfx <const> = playdate.graphics
|
||||||
local geom <const> = playdate.geometry
|
local geom <const> = playdate.geometry
|
||||||
|
|
||||||
class("Wave").extends()
|
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 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
|
return w
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user