-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.py
28 lines (24 loc) · 835 Bytes
/
Player.py
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
26
27
28
import pygame
class Perso:
def __init__(self) -> None:
self.x =2000
self.y =2000
self.vit =1
self.dir ="none"
def Draw(self, ecran) :
pygame.draw.circle(ecran, (255,255,255), (self.x,self.y), 20)
def DrawEnemy(self, ecran) :
pygame.draw.circle(ecran, (255,255,0), (self.y,self.x), 20)
def DrawBigEnemy(self, ecran) :
pygame.draw.circle(ecran, (255,0,0), (self.y,self.x), 20)
def DrawBossEnemy(self, ecran) :
pygame.draw.circle(ecran, (135,206,250), (self.y,self.x), 20)
def Update(self):
if self.dir == 'up':
self.y-=self.vit
elif self.dir == "down":
self.y+= self.vit
elif self.dir == "left":
self.x-= self.vit
elif self.dir == "right":
self.x+= self.vit