-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgame.py
More file actions
25 lines (20 loc) · 858 Bytes
/
Copy pathgame.py
File metadata and controls
25 lines (20 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pygame
from players import Player1, Player2
class Game:
def __init__(self):
self.is_playing = False
self.player1 = Player1("guerrier", self)
self.player2 = Player2("assassin", self)
self.pressed = {}
self.all_players = pygame.sprite.Group()
self.all_players.add(self.player1)
self.all_players.add(self.player2)
def check_collision(self, sprite, group):
return pygame.sprite.spritecollide(sprite, group, False, pygame.sprite.collide_mask)
def update(self, screen):
# appliquer l'image de mon joueur
screen.blit(self.player1.image, self.player1.rect)
screen.blit(self.player2.image, self.player2.rect)
# actualiser l'animation du joueur
self.player1.update_animation()
self.player2.update_animation()