Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- npc = {
- " -------- ",
- "| |",
- "| |",
- " --------",
- "Merchant"}
- local function picture(image,positionX,positionY)
- for y = 1,#image do
- term.setCursorPos(positionX,positionY + y - 1)
- term.write(image[y])
- end
- end
- local posX,posY = 1,1
- while true do
- term.clear()
- picture(npc,posX,posY)
- local event = {os.pullEvent()}
- if event[1] == "key" then
- if event[2] == 200 then
- posY = posY - 1
- elseif event[2] == 208 then
- posY = posY + 1
- elseif event[2] == 203 then
- posX = posX - 1
- elseif event[2] == 205 then
- posX = posX + 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement