Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rojo = color.new( 255, 0, 0 )
- azul = color.new( 0, 0, 255)
- verde = color.new( 0, 255,0)
- size=0.8
- tiempo={}
- crono={tiempo=timer.new(),status="pause"}
- crono.tiempo:reset(); crono.tiempo:stop();
- while true do
- controls.read()
- for i = 1, #tiempo do
- screen.print(200,50+(i-1)*16,i..": ",size,verde,0x0)
- screen.print(200+screen.textwidth(i..": "),50+(i-1)*16,tiempo[i],size,rojo,0x0)
- end
- if controls.press("cross") then
- if crono.tiempo:time() == 0 then
- crono.tiempo:start()
- crono.status="running"
- elseif crono.tiempo:time() > 0 then
- table.insert(tiempo,crono.tiempo:time()/1000)
- end
- end
- if controls.press("start") then
- if crono.status == "pause" then
- crono.tiempo:start()
- crono.status="running"
- elseif crono.status == "running" then
- crono.tiempo:stop()
- crono.status="pause"
- end
- end
- if controls.press("circle") then
- crono.tiempo:reset(); crono.tiempo:stop();
- crono.status="pause"
- end
- if controls.r() and controls.l() then
- tiempo={}
- end
- screen.print(200,20,crono.tiempo:time()/1000,size,azul,0x0)
- if controls.select() then a() end
- screen.flip()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement