Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pocket4
- -- 四角形が縦に動く
- -- Functions
- function init()
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- term.clear()
- end
- function drawPoint(x,y,color)
- term.setBackgroundColor(color)
- term.setCursorPos(x,y)
- term.write(" ")
- end
- function drawSquare(x,y,color)
- drawPoint(x,y,color)
- drawPoint(x+1,y,color)
- drawPoint(x, y+1, color)
- drawPoint(x+1, y+1, color)
- end
- -- Main
- for y=1,20 do
- init() -- 画面を初期化する
- drawSquare(2,y,colors.red) -- 指定した座標に指定した色で点を描く
- os.sleep(0.5) -- 0.5秒待つ
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement