forked from alesan99/mari0_ae
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckpoint.lua
More file actions
41 lines (35 loc) · 800 Bytes
/
checkpoint.lua
File metadata and controls
41 lines (35 loc) · 800 Bytes
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
--record holder for the 2nd most simple entity ever
checkpointentity = class:new()
function checkpointentity:init(x, y, r, i)
self.cox = x
self.coy = y
self.r = r
self.i = i
self.active = false
self.static = true
end
function checkpointentity:link()
self.outtable = {}
if #self.r > 2 then
for j, w in pairs(outputs) do
for i, v in pairs(objects[w]) do
if tonumber(self.r[4]) == v.cox and tonumber(self.r[5]) == v.coy then
v:addoutput(self)
end
end
end
end
end
function checkpointentity:input(t)
if t == "on" then
self:activate()
--elseif t == "off" then
elseif t == "toggle" then
self:activate()
end
end
function checkpointentity:activate()
checkpointi = self.i
checkpointx = self.cox--checkpoints[checkpointi]
checkpointsublevel = actualsublevel
end