grafika-init
This commit is contained in:
parent
ca13578946
commit
ecb0b8e426
BIN
assets/player.png
Normal file
BIN
assets/player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
2
main.py
2
main.py
@ -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()
|
||||
|
10
traktor.py
10
traktor.py
@ -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)
|
Loading…
Reference in New Issue
Block a user