Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local LR,UD = 0,0
- while true do
- X, Y = term.getCursorPos()
- local function drawBall(x,y)
- term.setCursorPos(x,y)
- print("O")
- end
- if X == 1 then
- LR = 1
- elseif X == 51 then
- LR = 0
- end
- if Y == 1 then
- UD = 0
- elseif Y == 19 then
- UD = 1
- end
- if LR == 1 then
- xpos = X + 1
- elseif LR == 0 then
- xpos = X - 1
- end
- if UD == 1 then
- ypos = Y + 1
- elseif UD == 0 then
- ypos = Y - 1
- end
- drawBall(xpos,ypos)
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement