コード例 #1
0
ファイル: Map.py プロジェクト: john2x/tetrys
 def __check_move(self, block, pos):
     temp = Grid(self.width, self.height)
     self.background.copy_content_into(temp)
     
     area = temp.get_area(block.size, pos)
     if area == None:
         print 'out of bounds'
         return 0
     
     for y in range(len(area)):
         for x in range(len(area[y])):
             if block.grid[y][x] > 0:
                 cell = area[y][x]
                 if cell == 9:
                     return 0
                 elif cell == 8:
                     return HIT_FLOOR
                 elif cell == 10:
                     pass
                 elif cell > 0:
                     return HIT_BLOCK
     return 1