unknown wips
This commit is contained in:
parent
bc143056e8
commit
330602f0fc
24
patternsidea.lua
Normal file
24
patternsidea.lua
Normal file
@ -0,0 +1,24 @@
|
||||
-- PATTERN: table of patterns to be sent on initialization and/or
|
||||
-- after "program" channel receives a pattern table
|
||||
-- Patterns individually sent on "setsort"
|
||||
-- Completion message sent on "status"
|
||||
|
||||
function send()
|
||||
if mem.send > 0 then
|
||||
digiline_send("setsort", PATTERN[mem.send])
|
||||
mem.send = mem.send - 1
|
||||
interrupt(1.2)
|
||||
elseif mem.send == 0 then
|
||||
digiline_send("status", "Programming complete.")
|
||||
else
|
||||
mem.send = #PATTERN
|
||||
interrupt(1.2)
|
||||
end
|
||||
end
|
||||
|
||||
if (event.type == "program" and PATTERN) or event.type == "interrupt" then
|
||||
send()
|
||||
elseif event.type == "digiline" and event.channel == "program" then
|
||||
PATTERN = event.msg
|
||||
send()
|
||||
end
|
2
src/Floor.moon
Normal file
2
src/Floor.moon
Normal file
@ -0,0 +1,2 @@
|
||||
class Floor
|
||||
new: =>
|
1
unrelatred.txt
Normal file
1
unrelatred.txt
Normal file
@ -0,0 +1 @@
|
||||
The RFC says that if there's no MX the mail client should fall back to the A record
|
46
wip.lua
Normal file
46
wip.lua
Normal file
@ -0,0 +1,46 @@
|
||||
-- assume that the engine will create these
|
||||
local floor = {}
|
||||
floor.entity = {}
|
||||
fn = function(code)
|
||||
-- TODO sandbox code appropriately
|
||||
end
|
||||
floor.get = function(self, x, y)
|
||||
-- TODO whatever is returned by this can be compared with a string to see if its character matches
|
||||
-- TODO this should return a second value, a table of entities! or empty table
|
||||
end
|
||||
|
||||
-- below here is created by the user
|
||||
floor.entity[1] = { x = 0, y = 0, character = "@" } -- entity drawing defaults: character="e",color={1,1,1,1},background={0,0,0,1}
|
||||
floor.global_functions = {}
|
||||
floor.global_functions.action = function(x, y)
|
||||
local player = floor.entity[1]
|
||||
local target, entities = floor:get(x, y)
|
||||
if target == " " and #entities == 0 then
|
||||
player.x = x
|
||||
player.y = y
|
||||
-- TODO elseif entities / other things
|
||||
end
|
||||
end
|
||||
|
||||
-- assumes engine will call it to initialize a floor before it is used
|
||||
floor.init = function()
|
||||
for name, code in pairs(floor.global_functions) do
|
||||
_G[name] = fn(code)
|
||||
end
|
||||
if not floor.generated then
|
||||
-- TODO generate this floor!
|
||||
end
|
||||
end
|
||||
|
||||
floor.update = function(key)
|
||||
local player = floor.entity[1]
|
||||
if key == "up" then
|
||||
action(player.x, player.y - 1)
|
||||
elseif key == "left" then
|
||||
action(player.x - 1, player.y)
|
||||
elseif key == "down" then
|
||||
action(player.x, player.y + 1)
|
||||
elseif key == "right" then
|
||||
action(player.x + 1, player.y)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user