mirror of
https://github.com/EDeev/pixel_gamble.git
synced 2026-06-16 03:21:03 +03:00
Delete camera.py
This commit is contained in:
parent
9c085291f0
commit
82c0587d6d
1 changed files with 0 additions and 19 deletions
|
|
@ -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) # ОТРИСОВКА
|
||||
Loading…
Add table
Reference in a new issue