Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Xadrez:createPieces()
- local piecepos = {}
- pieces = {"tower", "horse", "bishop", "queen", "king","bishop","horse","tower"}
- for _, index in pairs({0,1,6,7}) do piecepos[index] = {} end
- for index, piece in pairs(pieces) do
- piecepos[0][index-1] = "white "..piece
- piecepos[7][index-1] = "black "..piece
- end
- for i = 0, 7 do
- piecepos[1][i] = "white pawn"
- piecepos[6][i] = "black pawn"
- end
- for x = 0, 7 do
- for y = 0, 7 do
- local pos = {x = INITIAL_POS.x, y = INITIAL_POS.y, z = INITIAL_POS.z}
- pos.x, pos.y = (pos.x + x), (pos.y + y)
- print(tostring(x) .." > ".. tostring(y))
- local creature = getTopCreature(pos)
- if(isCreature(creature.uid) and not isPlayer(creature.uid))then
- doRemoveCreature(creature.uid)
- end
- if(piecepos[y] and piecepos[y][x]) then
- doCreateMonster(piecepos[y][x], pos)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement