Exemple #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
        ]
Exemple #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
        ]
Exemple #3
0
 def _get_pixel_pos(self, pos):
     px, py = hex_to_pixel(self.game.hex_layout, Hex(*pos))
     return px, py
Exemple #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)
 def _get_hex_pos(self, pos):
     px, py = hex_to_pixel(self.game.hex_layout, Hex(*pos))
     py -= GameObject.ACTOR_OFFSET
     return px, py