diff --git a/asset/asset.svg b/asset/asset.svg
index 64228d0..f2a26f4 100644
--- a/asset/asset.svg
+++ b/asset/asset.svg
@@ -25,9 +25,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="11.2"
- inkscape:cx="-1065.1419"
- inkscape:cy="195.80413"
+ inkscape:zoom="2.8"
+ inkscape:cx="-990.35093"
+ inkscape:cy="138.68996"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
@@ -49,7 +49,7 @@
image/svg+xml
-
+
@@ -58,12 +58,12 @@
inkscape:groupmode="layer"
id="layer1">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/asset/perso1.png b/asset/perso1.png
deleted file mode 100644
index a23c148..0000000
Binary files a/asset/perso1.png and /dev/null differ
diff --git a/asset/perso1_down.png b/asset/perso1_down.png
new file mode 100644
index 0000000..c8ac470
Binary files /dev/null and b/asset/perso1_down.png differ
diff --git a/asset/perso1_left.png b/asset/perso1_left.png
new file mode 100644
index 0000000..52807de
Binary files /dev/null and b/asset/perso1_left.png differ
diff --git a/asset/perso1_right.png b/asset/perso1_right.png
new file mode 100644
index 0000000..cca4d30
Binary files /dev/null and b/asset/perso1_right.png differ
diff --git a/asset/perso1_up.png b/asset/perso1_up.png
new file mode 100644
index 0000000..2c49444
Binary files /dev/null and b/asset/perso1_up.png differ
diff --git a/asset/perso2.png b/asset/perso2.png
deleted file mode 100644
index 43ab79e..0000000
Binary files a/asset/perso2.png and /dev/null differ
diff --git a/asset/perso2_down.png b/asset/perso2_down.png
new file mode 100644
index 0000000..340fc49
Binary files /dev/null and b/asset/perso2_down.png differ
diff --git a/asset/perso2_left.png b/asset/perso2_left.png
new file mode 100644
index 0000000..e9226a2
Binary files /dev/null and b/asset/perso2_left.png differ
diff --git a/asset/perso2_right.png b/asset/perso2_right.png
new file mode 100644
index 0000000..f3861e0
Binary files /dev/null and b/asset/perso2_right.png differ
diff --git a/asset/perso2_up.png b/asset/perso2_up.png
new file mode 100644
index 0000000..c91234f
Binary files /dev/null and b/asset/perso2_up.png differ
diff --git a/main.py b/main.py
index c963a09..92b5016 100644
--- a/main.py
+++ b/main.py
@@ -20,8 +20,8 @@ WHITE=(255,255,255)
BLUE=(0,0,255)
RED=(255,0,0)
-perso1 = perso('Alice',200,200,pygame.K_o,pygame.K_l,pygame.K_k,pygame.K_m,'asset/perso1.png')
-perso2 = perso('Bjorn',600,600,pygame.K_z,pygame.K_s,pygame.K_q,pygame.K_d,'asset/perso2.png')
+perso1 = perso('Alice',200,200,pygame.K_o,pygame.K_l,pygame.K_k,pygame.K_m,'asset/perso1')
+perso2 = perso('Bjorn',600,600,pygame.K_z,pygame.K_s,pygame.K_q,pygame.K_d,'asset/perso2')
speed = 1
diff --git a/models.py b/models.py
index fc49fbe..30984ab 100644
--- a/models.py
+++ b/models.py
@@ -15,7 +15,11 @@ class perso():
self.key_down = key_down
self.key_left = key_left
self.key_right = key_right
- self.img = pygame.image.load(texture)
+ self.img_up = pygame.image.load(texture+'_up.png')
+ self.img_down = pygame.image.load(texture+'_down.png')
+ self.img_right = pygame.image.load(texture+'_right.png')
+ self.img_left = pygame.image.load(texture+'_left.png')
+ self.img = self.img_up
self.size = self.img.get_size()
def check_move(self,keystate,screen_width,screen_height,speed):
@@ -23,18 +27,22 @@ class perso():
self.posx -= speed
if self.posx <0:
self.posx=0
+ self.img = self.img_left
if keystate[self.key_right]:
self.posx += speed
if self.posx+self.size[0] > screen_width:
self.posx = screen_width-self.size[0]
+ self.img = self.img_right
if keystate[self.key_up]:
self.posy -= speed
if self.posy < 0:
self.posy = 0
+ self.img = self.img_up
if keystate[self.key_down]:
self.posy += speed
if self.posy+self.size[1] > screen_height:
self.posy = screen_height-self.size[1]
+ self.img = self.img_down
def draw(self,surface):
surface.blit(self.img,(self.posx,self.posy))
\ No newline at end of file