2023-03-30 15:51:20 +02:00
|
|
|
import pygame
|
|
|
|
from config import *
|
|
|
|
|
|
|
|
class Rocks(pygame.sprite.Sprite):
|
|
|
|
|
|
|
|
def __init__(self,game,x,y):
|
|
|
|
self.game = game
|
2023-05-04 14:06:31 +02:00
|
|
|
self.groups = self.game.rock_sprites
|
|
|
|
|
2023-03-30 15:51:20 +02:00
|
|
|
pygame.sprite.Sprite.__init__(self, self.groups)
|
|
|
|
|
|
|
|
self.x = x * TILE_SIZE
|
|
|
|
self.y = y * TILE_SIZE
|
|
|
|
self.width = TILE_SIZE
|
|
|
|
self.height = TILE_SIZE
|
|
|
|
|
2023-06-01 16:09:01 +02:00
|
|
|
self.ROCKS_PNG = pygame.image.load("./pozostale_zdjecia/rock.png")
|
2023-03-30 15:51:20 +02:00
|
|
|
self.ROCKS = pygame.transform.scale(self.ROCKS_PNG,(64,64))
|
|
|
|
|
|
|
|
self.image = pygame.Surface([self.width, self.height])
|
|
|
|
self.image.blit(self.ROCKS,(0,0))
|
|
|
|
self.image.set_colorkey((0, 0, 0))
|
|
|
|
|
|
|
|
self.rect = self.image.get_rect()
|
|
|
|
self.rect.x = self.x
|
|
|
|
self.rect.y = self.y
|
2023-05-04 14:06:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Grass(pygame.sprite.Sprite):
|
|
|
|
|
|
|
|
def __init__(self,game,x,y):
|
|
|
|
self.game = game
|
|
|
|
self.groups = self.game.grass_sprites
|
|
|
|
pygame.sprite.Sprite.__init__(self, self.groups)
|
|
|
|
|
|
|
|
self.x = x * TILE_SIZE
|
|
|
|
self.y = y * TILE_SIZE
|
|
|
|
self.width = TILE_SIZE
|
|
|
|
self.height = TILE_SIZE
|
|
|
|
|
2023-06-01 16:09:01 +02:00
|
|
|
self.GRASS_PNG = pygame.image.load("./pozostale_zdjecia/grass.png")
|
2023-05-04 14:06:31 +02:00
|
|
|
self.GRASS = pygame.transform.scale(self.GRASS_PNG,(64,64))
|
|
|
|
|
|
|
|
self.image = pygame.Surface([self.width, self.height])
|
|
|
|
self.image.blit(self.GRASS,(0,0))
|
|
|
|
self.image.set_colorkey((0, 0, 0))
|
|
|
|
|
|
|
|
self.rect = self.image.get_rect()
|
|
|
|
self.rect.x = self.x
|
|
|
|
self.rect.y = self.y
|
|
|
|
|
|
|
|
self.cost = 10
|
|
|
|
|
|
|
|
self._layer = GRASS_LAYER
|
|
|
|
|
|
|
|
class Health_flower(pygame.sprite.Sprite):
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, game, x, y):
|
|
|
|
self.game = game
|
|
|
|
self.groups = self.game.flowers,
|
|
|
|
pygame.sprite.Sprite.__init__(self, self.groups)
|
|
|
|
|
|
|
|
self.x = x * TILE_SIZE
|
|
|
|
self.y = y * TILE_SIZE
|
|
|
|
self.width = TILE_SIZE
|
|
|
|
self.height = TILE_SIZE
|
|
|
|
|
2023-06-01 16:09:01 +02:00
|
|
|
self.FLOWER_IMG = pygame.image.load("./pozostale_zdjecia/flower.png")
|
2023-05-04 14:06:31 +02:00
|
|
|
self.FLOWER = pygame.transform.scale(self.FLOWER_IMG,(64,64))
|
|
|
|
|
|
|
|
self.image = pygame.Surface([self.width, self.height])
|
|
|
|
self.image.blit(self.FLOWER, (0,0))
|
|
|
|
self.image.set_colorkey((0, 0, 0))
|
|
|
|
|
|
|
|
self.rect = self.image.get_rect()
|
|
|
|
self.rect.x = self.x
|
|
|
|
self.rect.y = self.y
|
|
|
|
|
|
|
|
self._layer = FLOWER_LAYER
|
|
|
|
|
2023-05-04 14:18:50 +02:00
|
|
|
class Little_Rocks(pygame.sprite.Sprite):
|
|
|
|
|
|
|
|
def __init__ (self,game,x,y):
|
|
|
|
self.game = game
|
|
|
|
self.groups = self.game.all_sprites, self.game.little_rock_sprites
|
|
|
|
pygame.sprite.Sprite.__init__(self, self.groups)
|
|
|
|
|
|
|
|
self.x = x * TILE_SIZE
|
|
|
|
self.y = y * TILE_SIZE
|
|
|
|
self.width = TILE_SIZE
|
|
|
|
self.height = TILE_SIZE
|
|
|
|
|
2023-06-01 16:09:01 +02:00
|
|
|
self.LITTLE_ROCKS_PNG = pygame.image.load("./pozostale_zdjecia/little_rocks.png")
|
2023-05-04 14:18:50 +02:00
|
|
|
self.LITTLE_ROCKS = pygame.transform.scale(self.LITTLE_ROCKS_PNG,(64,64))
|
|
|
|
|
|
|
|
self.image = pygame.Surface([self.width, self.height])
|
|
|
|
self.image.blit(self.LITTLE_ROCKS,(0,0))
|
|
|
|
self.image.set_colorkey((0, 0, 0))
|
|
|
|
|
|
|
|
self.rect = self.image.get_rect()
|
|
|
|
self.rect.x = self.x
|
|
|
|
self.rect.y = self.y
|
2023-03-30 15:51:20 +02:00
|
|
|
|