- Afegit objecte "wait"
This commit is contained in:
20
data/wait.lua
Normal file
20
data/wait.lua
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user