Beispiel #1
0
 def getBlock(self, coordinate):
     i, j = [Utility.round(k) for k in coordinate]
     i, j = self.coordinateToIndex((i, j))
     if i < 0 or i >= self.width or j < 0 or j >= self.height:
         return Constants.AIR_BLOCK
     block = self.blocks[j][i]
     return block
Beispiel #2
0
 def setBlock(self, blockType, coordinate):
     i, j = [Utility.round(k) for k in coordinate]
     i, j = self.coordinateToIndex((i, j))
     self.blocks[j][i] = Block(blockType, i, j)