Advertisement
Wistaro

Pause_tiplanet.org_technolapin

Jul 19th, 2015
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local n = 0
  2. local pause = false
  3.  
  4. local ontimer = {
  5. [false] = function ()
  6.          n=n+1
  7.          platform.window: invalidate()
  8.          end
  9. }
  10.  
  11. local onpaint = {
  12. [false] = function (gc)
  13.            gc: drawString (n, 64, 64)
  14.        end
  15. , [true] = function (gc)
  16.            gc: drawString ("Paused, dumbass", 64, 64)
  17.        end
  18. }
  19.  
  20. timer.start (.01)
  21. function on.timer ()
  22.   pcall(ontimer[pause])
  23. end
  24.  
  25. function on.paint(gc)
  26.   onpaint[pause](gc)
  27. end
  28.  
  29. function on.enterKey ()
  30.   pause = not pause
  31.   platform.window: invalidate()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement