Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local scroll = 0;
- local jump = 0;
- local char = ">";
- function redraw()
- term.clear()
- term.setCursorPos(1,1)
- local x,y = term.getSize()
- term.setCursorPos(x/2, y-10)
- write(char)
- for i=1,x-1 do
- term.setCursorPos(i, y-9 + jump)
- write("A")
- end
- term.setCursorPos(x/2 - scroll, y-14 + jump)
- write("O")
- end
- while true do
- redraw()
- local event, a, b = os.pullEvent();
- if(event == "char" and a == "a")then
- scroll = scroll-1
- char = "<"
- elseif(event == "char" and a == "d")then
- scroll = scroll+1
- char = ">"
- elseif(event == "key" and a == 57)then
- jump = 1
- for i=1,4 do
- sleep(0.1)
- jump = i
- redraw()
- end
- for i=1,4 do
- sleep(0.1)
- jump = jump-i
- redraw()
- end
- jump = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement