grafika-init

This commit is contained in:
Jakub Adamski 2020-06-09 12:15:51 +02:00
parent ca13578946
commit ecb0b8e426
3 changed files with 8 additions and 4 deletions

BIN
assets/player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -122,7 +122,7 @@ class Game(object):
pygame.display.update()
#rysowanie
self.pole.fill((0,0,0))
self.pole.fill((157, 128, 48))
self.krata()
self.rysowanie()
pygame.display.flip()

View File

@ -10,8 +10,12 @@ class Traktor(object):
self.y = 0
self.punkt = 0
self.canSteer = True
self.myimage = pygame.image.load("./assets/player.png").convert()
self.myimage = pygame.transform.scale(self.myimage, (99, 99))
self.screen = pygame.display.set_mode((500, 500))
def rysowanie(self):
obje = pygame.Rect(self.x, self.y ,99,99)
pygame.draw.rect(self.game.pole, (0,100,255), obje)
def rysowanie(self):
rect = self.myimage.get_rect()
rect.center = (self.x+50, self.y+50)
self.screen.blit(self.myimage, rect)