示例#1
0
    def draw_overlap_trees(self, surface, hex):

        px, py = hex_to_pixel(self.game.hex_layout, hex)
        [
            self.tree_sprite.draw(surface, pos=(px + tx, py + ty))
            for tx, ty in TREE_POSITIONS
        ]
示例#2
0
    def _draw_tree(self, hex_coord):

        px, py = hex_to_pixel(self.game.hex_layout, Hex(*hex_coord))
        [
            self.tree_sprite.draw(self.surface, pos=(px + tx, py + ty))
            for (tx, ty) in TREE_POSITIONS
        ]
示例#3
0
 def _get_pixel_pos(self, pos):
     px, py = hex_to_pixel(self.game.hex_layout, Hex(*pos))
     return px, py
示例#4
0
    def _draw_tile(self, hex_coord):

        tile_image = get_tile_image(self.map.get_tile(hex_coord))
        pixel_coord = hex_to_pixel(self.game.hex_layout, Hex(*hex_coord))
        tile_image.draw(self.surface, pixel_coord)
示例#5
0
 def _get_hex_pos(self, pos):
     px, py = hex_to_pixel(self.game.hex_layout, Hex(*pos))
     py -= GameObject.ACTOR_OFFSET
     return px, py