- Afegit objecte "wait"

This commit is contained in:
2023-01-31 16:01:05 +01:00
parent 2fb0749cf7
commit db844e634c
3 changed files with 24 additions and 2 deletions

20
data/wait.lua Normal file
View File

@@ -0,0 +1,20 @@
wait={
start_time=0,
total_time=0,
old_update=nil,
start=function(seconds)
wait.old_update=update
update=wait.update
wait.total_time=seconds
wait.start_time=time()
end,
update=function()
wait.old_update()
if wait.total_time <= time()-wait.start_time then
update=wait.old_update
scene.cont()
end
end
}