-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.py
33 lines (26 loc) · 834 Bytes
/
log.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
This file contains the implememtation of the class Log.
Author: Alejandro Mujica (aledrums@gmail.com)
Date: 07/11/2020
"""
import pygame
import settings
class Log:
def __init__(self, x, y, position):
if position == 'lower':
self.texture = settings.GAME_TEXTURES['log']
else:
self.texture = pygame.transform.flip(
settings.GAME_TEXTURES['log'], False, True
)
self.x = x
self.y = y
self.width = self.texture.get_size()[0]
self.height = self.texture.get_size()[1]
self.position = position
def get_collision_rect(self):
return pygame.Rect(self.x, self.y, self.width, self.height)
def update(self, dt):
pass
def render(self, surface):
surface.blit(self.texture, (self.x, self.y))