Gra-SI/map_add_ons.py
2023-03-30 20:10:29 +02:00

27 lines
796 B
Python

import pygame
from config import *
class Rocks(pygame.sprite.Sprite):
def __init__(self,game,x,y):
self.game = game
self.groups = self.game.all_sprites, self.game.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
self.ROCKS_PNG = pygame.image.load("./zdjecia/rock.png")
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