Advertisement
guitarplayer616

Flame

May 27th, 2015
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. os.loadAPI(shell.resolve(".").."/gameutils")
  2.  
  3.  
  4. local obj1 = gameutils.loadAnimation(
  5.     shell.resolve(".").."/flame.nfa", 1, 1, 1)
  6.  
  7. gameutils.initializeBuffer()
  8. while true do
  9.   gameutils.clearBuffer(colours.black)
  10.   gameutils.writeToBuffer(obj1)
  11.   gameutils.drawBuffer()
  12.  
  13.   local _,key = os.pullEvent("key")
  14.   if key == keys.left then
  15.     obj1.x = obj1.x - 1
  16.   elseif key == keys.right then
  17.     obj1.x = obj1.x + 1
  18.   elseif key == keys.up then
  19.     obj1.y = obj1.y - 1
  20.   elseif key == keys.down then
  21.     obj1.y = obj1.y + 1
  22.   elseif key == keys.q then
  23.     break
  24.   end
  25.  
  26. term.setBackgroundColour(colours.black)
  27. shell.run("clear")
  28. sleep(0.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement