Advertisement
SuperRavenSn1per

Game API

Mar 23rd, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. function spawnPlayer(pic, x, y)
  2.   if pic == 0 then
  3.   plr = paintutils.loadImage("gameapi/defaultPlayer")
  4.   paintutils.drawImage(plr, x, y)
  5.   else
  6.   plr = paintutils.loadImage(pic)
  7.   paintutils.drawImage(plr, x, y)
  8.   end
  9. end
  10.  
  11. function titleScreen(txt, bgcolor)
  12.   w, h = term.getSize()
  13.   term.setBackgroundColor(bgcolor)
  14.   term.clear()
  15.   term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), h / 2)
  16.   print(txt)  
  17.   sleep(3)
  18.   term.setBackgroundColor(colors.black)
  19.   term.clear()
  20.   term.setCursorPos(1,1)
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement