-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.lua
More file actions
43 lines (38 loc) · 1.05 KB
/
Copy pathrender.lua
File metadata and controls
43 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
--system
function getrender()
local render = {}
render.__index = render
local system_type = "render"
setmetatable(render, {
__index = system, -- this is what makes the inheritance work
__call = function (klass, ...)
local self = setmetatable({}, klass)
self:_init(...)
return self
end,
})
function render:_init()
system._init(self, system_type) -- call the base class constructor
end
function render:render()
foreach(self.entitys,
function(e)
local trf = e:get("transform")
local s = e:get("sprite")
spr(
s:get_start_pix(),
trf:get_x(),
trf:get_y(),
s:get_size_w(),
s:get_size_h(),
s:get_flip_x(),
s:get_flip_y()
)
end
)
end
return render
end