Guest User

test

a guest
Feb 15th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local lp = shell.resolve(".")
  2. local w,h = term.getSize()
  3. local t = w/2 - 3
  4. local y = h/2 - 3
  5. os.loadAPI(lp.."/gameutils")
  6. local updateRate = 0.3
  7.  
  8. local fin = gameutils.loadAnimation(lp.."/.startup/fin.nfa", t, y, 1)
  9. fin.timerID = os.startTimer(updateRate)
  10.  
  11. local function runGame()
  12.   while true do
  13.   term.setBackgroundColour(colours.lightGrey)
  14.   term.clear()
  15.   fin:draw()
  16.  
  17.   local id,key = os.pullEvent("timer")
  18.   if fin:update(key) then
  19.     fin.timerID = os.startTimer(updateRate)
  20.   end
  21.  
  22.   if fin.currentFrame == fin.upperBound then
  23.     term.setCursorPos(1,1)
  24.     term.clear()
  25.     --code
  26.     return
  27.   end
  28.   end
  29. end
  30.  
  31. runGame()
Advertisement
Add Comment
Please, Sign In to add comment