WMICraft/models/castle.py

15 lines
523 B
Python
Raw Normal View History

2022-03-24 16:32:14 +01:00
import pygame.image
2022-04-11 00:01:57 +02:00
from common.helpers import parse_cord
2022-03-24 16:32:14 +01:00
class Castle(pygame.sprite.Sprite):
2022-04-10 20:28:50 +02:00
def __init__(self, position, group):
super().__init__(group)
self.image = pygame.image.load("./resources/textures/castle.png").convert_alpha()
2022-03-24 16:32:14 +01:00
self.image = pygame.transform.scale(self.image, (78, 78))
2022-04-11 12:56:22 +02:00
self.position = position
2022-04-11 12:00:15 +02:00
position_in_px = (parse_cord(position[0]), parse_cord(position[1]))
2022-04-11 00:01:57 +02:00
self.rect = self.image.get_rect(center=position_in_px)
2022-03-24 16:32:14 +01:00
self.health = 80