Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- event = require("event")
- component = require("component")
- term = require("term")
- Go = require("go")
- function show(t)
- for k,v in pairs(t) do
- print(k,v)
- end
- end
- gpu = component.gpu
- screen = component.screen
- SX, SY = gpu.getResolution()
- BG = 0x000055
- function redraw(game)
- gpu.setBackground(BG)
- gpu.fill(1,1,SX,SY,' ')
- term.setCursor(1,1)
- game:show()
- end
- game = Go:new(9)
- redraw(game)
- while true do
- e,adress,x,y,mouse = event.pull()
- if e == "touch" then
- game:touched(x, y)
- --redraw(game)
- end
- if e == "interrupted" then
- gpu.setBackground(0x000000)
- return
- end
- --print(e,adress,x,y,mouse)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement