style: fix inconsistent spacing & add newline at end of files
This commit is contained in:
parent
c99e738034
commit
e4aa771022
@ -9,6 +9,7 @@ class Field:
|
||||
self.tiles.add(Tile(x, 'grass', self))
|
||||
self.tractor = Tractor(self)
|
||||
|
||||
|
||||
def draw(self, surface):
|
||||
self.tiles.draw(surface)
|
||||
self.tractor.draw(surface)
|
||||
self.tractor.draw(surface)
|
||||
|
@ -24,4 +24,4 @@ if __name__ == "__main__":
|
||||
field.draw(screen)
|
||||
|
||||
pygame.display.flip()
|
||||
pygame.time.Clock().tick(10)
|
||||
pygame.time.Clock().tick(10)
|
||||
|
@ -24,14 +24,14 @@ class Tile(pygame.sprite.Sprite):
|
||||
self.rect = self.image.get_rect()
|
||||
self.rect.topleft = (x * TILE_SIZE, y * TILE_SIZE)
|
||||
|
||||
|
||||
def draw(self, surface):
|
||||
self.tiles.draw(surface)
|
||||
|
||||
|
||||
def set_type(self, type):
|
||||
self.type = type
|
||||
# if self.type == 'grass':
|
||||
# self.image = pygame.image.load("images/grass.png").convert()
|
||||
self.image = pygame.image.load("images/grass.png").convert()
|
||||
self.image = pygame.transform.scale(self.image, (TILE_SIZE, TILE_SIZE))
|
||||
|
||||
|
||||
|
@ -8,9 +8,11 @@ class Tractor(pygame.sprite.Sprite):
|
||||
def __init__(self, field):
|
||||
super().__init__
|
||||
self.field = field
|
||||
|
||||
self.image = pygame.image.load('images/tractor.png').convert_alpha()
|
||||
self.image = pygame.transform.scale(self.image, (TILE_SIZE, TILE_SIZE))
|
||||
self.rect = self.image.get_rect()
|
||||
|
||||
x, y = 0, 0
|
||||
self.rect.topleft = (x, y)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user