- Afegit objecte "wait"
This commit is contained in:
@@ -3,4 +3,4 @@ config=ja2
|
||||
width=160
|
||||
height=144
|
||||
zoom=5
|
||||
files=switches.lua,scene.lua,balloon.lua,actors.lua,game.lua,mapa.lua,editor.lua,textbox.lua,menu.lua,main.lua
|
||||
files=wait.lua,switches.lua,scene.lua,balloon.lua,actors.lua,game.lua,mapa.lua,editor.lua,textbox.lua,menu.lua,main.lua
|
||||
|
||||
@@ -16,7 +16,9 @@ game={
|
||||
flags.usu1=true
|
||||
scene.start({
|
||||
function() actors.search("usufondo").path={pos=0,route='rrrruro'} end,
|
||||
function() balloon.show("HOLA\nQUE TAL?","usufondo",true) end
|
||||
function() balloon.show("HOLA\nQUE TAL?","usufondo",true) end,
|
||||
function() wait.start(1) end,
|
||||
function() balloon.show("PAYASO...","jailer",true) end
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
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