Delete camera.py

This commit is contained in:
Egor Deev 2022-03-02 17:11:49 +07:00 committed by GitHub
parent 9c085291f0
commit 82c0587d6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +0,0 @@
import pygame
class Camera(pygame.sprite.Group):
def __init__(self):
super().__init__()
self.screen = pygame.display.get_surface() # ПОЛУЧЕНИЕ ЭКРАНА
self.w_half = self.screen.get_size()[0] // 2 # ПОЛОВИНА ШИРИНЫ
self.h_half = self.screen.get_size()[1] // 2 # ПОЛОВИНА ВЫСОТЫ
self.atone = pygame.math.Vector2() # ПОЗИЦИЯ КАМЕРЫ
def picture(self, player):
# ПОЛУЧЕНИЕ ПОЗИЦИИ ИГРОКА
self.atone.x = player.rect.centerx - self.w_half
self.atone.y = player.rect.centery - self.h_half
for sprite in sorted(self.sprites(), key=lambda sprite: sprite.rect.centery):
atone_pos = sprite.rect.topleft - self.atone
self.screen.blit(sprite.image, atone_pos) # ОТРИСОВКА