Оновити 'nauka2.py'

Some comments (need more)
This commit is contained in:
Serhii Hromov 2020-04-06 19:41:07 +00:00
parent 9398e185a6
commit 31e1f5e44a

View File

@ -67,11 +67,11 @@ class Order:
def __int__(self, x, y, id):
self.x = x
self.y = y
self.id = id
self.id = id #all orders will have their own number
def draw():
screen.blit(background_image, [0, 0])
screen.blit(background_image, [0, 0]) #background render
screen.blit(player.surf, player.rect)
player_list.draw(screen)
pygame.display.flip()
@ -162,7 +162,7 @@ class Player(pygame.sprite.Sprite):
newKey = 'down'
self.same(newKey, self.images1)
elif pressed_keys[K_UP]:
newKey = 'up'
newKey = 'up' #changing animation
self.same(newKey, self.images4)
elif pressed_keys[K_LEFT]:
newKey = 'left'
@ -174,7 +174,7 @@ class Player(pygame.sprite.Sprite):
pygame.init()
clock = pygame.time.Clock()
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) #to render a window
player = Player()
player.rect.x = 22
player.rect.y = 22