I have found things but they won't work?
I know computercraft has a sleep( seconds ) but I want to make this for myself…
How would you do this?
Things I have already tried
local clock = os.clock
function sleep(n) -- seconds
local t0 = clock()
while clock() - t0 <= n do end
end
Also, how do I change images?
I have it redefine to sprite = "guy.png" – Different API
Example, when you hit a key it should change images but it doesnt.
Code:
-- DOWN
if event.y > 278 and event.y < 310 and event.x > 32 and event.x < 64 then
print( "DOWN" )
local sprite = "guy.png"
for i = 1,5 do
char.y = char.y + 1
end
end