feat: add new sprites & direction to tractor

This commit is contained in:
Wojciech Kubicki 2024-04-10 17:33:11 +02:00
parent 505926461e
commit e6566cee48
7 changed files with 3 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

BIN
src/images/tractor/east.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/images/tractor/west.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -9,10 +9,12 @@ class Tractor(pygame.sprite.Sprite):
super().__init__
self.field = field
self.image = pygame.image.load('images/tractor.png').convert_alpha()
self.image = pygame.image.load('images/tractor/east.png').convert_alpha()
self.image = pygame.transform.scale(self.image, (TILE_SIZE, TILE_SIZE))
self.rect = self.image.get_rect()
self.direction = 'east'
x, y = 0, 0
self.rect.topleft = (x, y)