Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component = require("component")
- modem = require("component").modem
- event = require("event")
- event.pull = require("event").pull
- gpu = require("component").gpu
- x = 1
- y = 1
- modem.open(1)
- gpu.setResolution(50,16)
- gpu.fill(1,1,50,16," ")
- while true do
- _,_,_,_,_,a = event.pull(modem_message)
- if a == "W" then
- y = y - 1
- gpu.set(x,y,"#")
- else
- if a == "S" then
- y = y + 1
- gpu.set(x,y,"#")
- else
- if a == "A" then
- x = x - 1
- gpu.set(x,y,"#")
- else
- if a == "D" then
- x = x + 1
- gpu.set(x,y,"#")
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement