Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 1
- y = 5
- local function grav()
- if y<19 then
- y = y+1
- end
- end
- local function input()
- local event, key = os.pullEvent("key")
- if key == keys.d then
- x=x+1
- paintutils.drawPixel(x-1,y,32768)
- end
- if key == keys.a then
- x=x-1
- paintutils.drawPixel(x+1,y,32768)
- end
- if key == keys.w then
- y=y-2
- paintutils.drawPixel(x,y+2,32768)
- end
- end
- local function draw()
- paintutils.drawPixel(x,y,8)
- sleep(0.02)
- paintutils.drawPixel(x,y,32768)
- grav()
- end
- while true do
- parallel.waitForAny(input,draw)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement