pixel_gamble/code/tile.py
2022-02-19 09:14:43 +07:00

11 lines
547 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import pygame
from data import *
# КЛАСС ОТВЕЧАЕТ ЗА ОТРИСОВКУ ОДНОГО СПРАЙТА КАРТЫ В ВЫБРАННОЙ ПОЗИЦИИ
class Tile(pygame.sprite.Sprite):
def __init__(self, pos, groups):
super().__init__(groups)
self.image = pygame.image.load("../data/textures/earth/rock.png").convert_alpha() # ЗАГРУЗКА
self.rect = self.image.get_rect(topleft=pos) # ОТРИСОВКА
self.hitbox = self.rect.inflate(0, -10) # РАЗМЕР ХИТБОКСА