Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local G = 1
- local speed = 1
- local position = 3
- local w,h = term.getSize()
- local timeS = os.clock()
- function draw()
- term.setCursorPos(1,1)
- print(diff)
- print(speed)
- print(timeS)
- print(position)
- sleep(1)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setBackgroundColor(colors.red)
- term.setCursorPos(math.floor(w/4),position)
- term.write(" ")
- end
- function phy()
- diff = os.clock()- timeS
- position = position + (speed*diff) + (G*diff*diff)/2
- timeS = os.clock()
- speed = speed + G*diff
- end
- while true do
- sleep(.5)
- phy()
- draw()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement