()
| 43 | ############################### |
| 44 | |
| 45 | def animation() : |
| 46 | global Xp, Yp, Anim, num, dialogue, Xt1, Yt1, Xt2, Yt2, Xa, Ya, money, end |
| 47 | Xpav, Ypav = Xp, Yp |
| 48 | if "Up" in touches : |
| 49 | if Decors[(Yp-16)//64][(Xp)//64] in (' ','-','O','P','i', 'm', 'c', 'w', 'v','n','!','b','W','a','f','s','o','k','u') : |
| 50 | Yp = Yp - 8 |
| 51 | NomFichier = 'PERSOH' |
| 52 | if "space" in touches : |
| 53 | NomFichier = 'PERSOAH' |
| 54 | |
| 55 | if "Down" in touches : |
| 56 | if Decors[(Yp+32)//64][(Xp)//64] in (' ','-','O','P','i', 'm', 'c', 'w', 'v','n','!','b','W','a','f','s','o','k','u') : |
| 57 | Yp = Yp + 8 |
| 58 | NomFichier = 'PERSOB' |
| 59 | if "space" in touches : |
| 60 | NomFichier = 'PERSOAB' |
| 61 | |
| 62 | if "Left" in touches : |
| 63 | if Decors[(Yp)//64][(Xp-32)//64] in (' ','-','O','P','i', 'm', 'c', 'w', 'v','n','!','b','W','a','f','s','o','k','u') : |
| 64 | Xp = Xp - 8 |
| 65 | NomFichier = 'PERSOG' |
| 66 | if "space" in touches : |
| 67 | NomFichier = 'PERSOAG' |
| 68 | |
| 69 | if "Right" in touches : |
| 70 | if Decors[(Yp)//64][(Xp+32)//64] in (' ','-','O','P','i', 'm', 'c', 'w', 'v','n','!','b','W','a','f','s','o','k','u') : |
| 71 | Xp = Xp + 8 |
| 72 | NomFichier = 'PERSOD' |
| 73 | if "space" in touches : |
| 74 | NomFichier = 'PERSOAD' |
| 75 | |
| 76 | if Decors[(Yp)//64][(Xp+32)//64] in '0' : |
| 77 | Xpav, Ypav = Xp, Yp |
| 78 | |
| 79 | |
| 80 | # Combats |
| 81 | if Xt1-50 < Xp < Xt1+50 and Yt1-50 < Yp < Yt1+50 : |
| 82 | if "space" in touches : |
| 83 | winsound.PlaySound("sons/zombie.wav", winsound.SND_ASYNC) |
| 84 | boite.delete('trolln1') |
| 85 | Xt1, Yt1 = -32, -32 |
| 86 | if "space" not in touches : |
| 87 | boite.itemconfigure(sprite, image=PERSOM) |
| 88 | |
| 89 | if Xt2-50 < Xp < Xt2+50 and Yt2-50 < Yp < Yt2+50 : |
| 90 | if "space" in touches : |
| 91 | winsound.PlaySound("sons/zombie.wav", winsound.SND_ASYNC) |
| 92 | boite.delete('trolln2') |
| 93 | Xt2, Yt2 = -32, -32 |
| 94 | if "space" not in touches : |
| 95 | boite.itemconfigure(sprite, image=PERSOM) |
| 96 | |
| 97 | if Xa-50 < Xp < Xa+50 and Ya-50 < Yp < Ya+50 : |
| 98 | if "space" in touches : |
| 99 | winsound.PlaySound("sons/criscorpionquimeurt.wav", winsound.SND_ALIAS) |
| 100 | boite.delete('boss') |
| 101 | Xa, Ya = -32, -32 |
| 102 | dialogue=2 |
no test coverage detected