Advertisement
xerpi

Untitled

Apr 14th, 2011
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. rojo = color.new( 255, 0, 0 )
  2. azul = color.new( 0, 0, 255)
  3. size=0.8
  4.  
  5. tiempo={}
  6.  
  7. crono={tiempo=timer.new(),status="stop"}
  8. crono.tiempo:reset(); crono.tiempo:stop();
  9.  
  10. while true do
  11. controls.read()
  12.  
  13.  
  14. for i = 1, #tiempo do
  15.     screen.print(200,50+(i-1)*15,i..": "..tiempo[i],size,rojo,0x0)
  16. end
  17.  
  18. if controls.press("cross") then
  19.     if crono.tiempo:time() == 0 then
  20.         crono.tiempo:start()
  21.     elseif crono.tiempo:time() > 0 then
  22.         table.insert(tiempo,crono.tiempo:time()/1000)
  23.     end
  24. end
  25.  
  26.  
  27.  
  28. if controls.r() and controls.l() then
  29.     tiempo={}
  30. end
  31.  
  32.  
  33. screen.print(200,20,crono.tiempo:time()/1000,size,azul,0x0)
  34.  
  35. if controls.select() then a() end
  36.  
  37. screen.flip()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement