Оновити 'nauka2.py'
Some comments (need more)
This commit is contained in:
parent
9398e185a6
commit
31e1f5e44a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user