Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local term = require("term")
- local event = require("event")
- local comp = require("component")
- local gpu = comp.gpu
- local char_space = string.byte(" ")
- local running = true
- function unkownEvent()
- end
- local myEventHandlers = setmetatable({}, { __index = function() return unkownEvent end})
- function myEventHandlers.walk(screenAddress, x, y, player)
- print(x, y)
- print(player)
- trail(screenAddress, x, y, player)
- end
- function trail(screenAddress, x, y, player)
- gpu.bind(screenAddress)
- local w, h = gpu.maxResolution()
- gpu.fill(0, 0, w, h, "▐")
- end
- function handleEvent(eventID, ...)
- if (eventID) then
- myEventHandlers[eventID](...)
- end
- end
- while running do
- handleEvent(event.pull())
- end
Advertisement
Add Comment
Please, Sign In to add comment