Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- w, h=term.getSize()
- locations={}
- for i=1,w do
- locations[i]={}
- for z=1,h do
- locations[i][z]="Air"
- end
- end
- blocks={}
- block={}
- block.addBlock = function(name,char,backColor,frontColor)
- blocks[name]={}
- blocks[name].char=char:sub(1,1)
- blocks[name].backColor=backColor
- blocks[name].frontColor=frontColor
- blocks[name].easterEgg="While you are coding ill be STILL ALIVE."
- end
- block.renderBlock = function(name,x,y)
- locations[x][y]=name
- term.setCursorPos(x,y)
- term.setBackgroundColor(blocks[name].backColor)
- term.setTextColor(blocks[name].frontColor)
- write(blocks[name].char)
- end
- block.getBlock = function(x,y)
- return locations[x][y]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement