From 5e34471405b75c676dc948aee49bccf7739880af Mon Sep 17 00:00:00 2001 From: ayabusa Date: Wed, 23 Oct 2024 08:39:17 +0200 Subject: [PATCH] added a pnj --- assets/MiniPeasant.png | Bin 0 -> 11490 bytes assets/MiniVillagerMan.png | Bin 0 -> 2399 bytes assets/MiniWorker.png | Bin 0 -> 3761 bytes game.py | 122 +++++++++++++++++++++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 assets/MiniPeasant.png create mode 100644 assets/MiniVillagerMan.png create mode 100644 assets/MiniWorker.png diff --git a/assets/MiniPeasant.png b/assets/MiniPeasant.png new file mode 100644 index 0000000000000000000000000000000000000000..4f62827b19561f2c72e3aff1d261dd32a83cdfe7 GIT binary patch literal 11490 zcmeHsXH-+$)^_N<7wLr1krG1hARVQ5L?n>VLrdsIn)D9R5s)fP=~bl*2%>=Wu2Ka- zdi9N-bI(0@eD9w-#`pd^$=J!>bItk8IiES#8hecuqo<=zLdZY}002ldHB=0K{i82Z zd|dSJ(W8uU0DvjM-^dJQ0QCX7d%D>xdv=3aIhktFe$wW>!}KKGShFX%FL4IgaI>S(a!z*hl{$_gt%g7*-4}0}bjqcubM!bGqyPs9$;222sb*J&?g`Djx zdcQ;;SHB(B*8x9sLZ*LqpOs0R?a8LCmG_J#>29eaLxHCz?k|$g+|+bfUnp2fhzAGsK9YSK6zs|KqF`Zqr)l29{%G{#;?Z~W6LXO& z2R7*Tk;P;H?*_O0v|j|v17gFwy6Zm&$X(D~$!uYLm)V1UN z&dYFK+?M!vS1SwdHV`fa+j#5LW#b%Xjp`AuXsLIcq^|?yhIM&5_KmQJwHn zn`Z(EjapY7EQzg5)O6MMU+bGWh!aR(95(3>c; z+xf1xBgl93_4vu{ecW5TVB1r|S%QCBlRQsiNGeZe?E>=T1r-(s7%P?1aI zQj=elxWBD`jFQdJisCX!uQrR_!Z*ty4x_NPlGUeyidGJzWzLye}16RPWTW|QL) zQ)}#gClBn!XFNupbBoNtzytjmA$GZR(W`Rw?=*sw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d1aySSflS4;!P@T1a0f>Xe^0ofzmAcuzq73r45T1WDC;YY20*}3P@pfu z#T6;-D+l_GD~-PYB^Ck!f2*LJGC@rn5_`p1&%EE{!qM}f7VH*hnFcbn85ET}d5Rj4*feFB1 zqHsH?xR@Qx7Wy|RO;;oe>S_!B1%(C|bVTDwNJ@y>2}_6zh)Y831Vq7NQUa0^;-Uh! zaImnL6xdE!L{jW;5W1d@=&ppi{5`5)P%t!35Y_a>;#}TV7LGn z4221c!=ScMQJddTFk5LgH%|l?)E+M6?rQ&g;1}W2N_v`dAc!FN-x56+D9R3P zAP2hV=<4PB?*Su61l$k>{l%uR1Vl<)TtrMlR8mAj3@q_)B@?(O65WZvFonT_B7fli zDvLBa88orbUww)O_-%pCMOxVt4n?_n8o9Z-$bo)^1pH@qa0n zxP-W{tqs&hKv-NDT`UP(5dleYF{pq96bc55irc_oHh-k?7dq0-4&?*&ge%#jGeu{E zZlK@U0C|2>$@`zN_&C6S@dSp53J8M*AR8^k1`mY%Huay7kuK#az5&nC_19wHg1^J-2GiUZ9#OSRMuFYL_6~ND5-@;er zX=n+7yM{Ru03f3JbzuN<^61b)Jd~!kD&8jHEnHku?D6_b^nMqpsiI`WGZvIwq}!`U zKJW-Zo+d`FLGI;j*qutiH5n5ghI>lI-$>8s8TAj&AHyDQ8dst^rw8D8)678ej0f;z!*p;f! z-`J=rq~mCETME)zrqp1e&#{A+b%&q(ltDus73q3vE7+n0dTl z^a*m`YU2C1OMr*#7`jOZq4P literal 0 HcmV?d00001 diff --git a/assets/MiniVillagerMan.png b/assets/MiniVillagerMan.png new file mode 100644 index 0000000000000000000000000000000000000000..652f9d9d26350820da17fa293711d8e7f4ec4453 GIT binary patch literal 2399 zcmZuydpHyN8y^*+ixQ=YS?=l4F(_xpa|=lgu$=Y78K=ks|VxH#GFRy?c-004GF z?I5mF-z{C(opRFM=LF1O>SUr_ZLI;gj~a^rfPy*{Vs$N{oJlbZ)$r8p=Tzlq*tf-> ztm%6R&0enQJG%X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Q%@_C5WNS1^)Gm#u z@FrPTao@Iwyj&8(on(D;P)bwSZS=udr5ImJJUbyu2U<(@1wx-w{Y#1Y&uD)KGto2V zPqgSmBK@|{6RsLr%*!zQvDb>RuwDw&XhVAueKc>))@z#T9Iz@?9P@rLW@P&>zjKNO ziZhpCfsU^()AxCD6=D%X_2MHhMZ}`(vxE%kq{1)e?Zd`lM7$m!vvNWoHn-OL$FsReERH zwyOPTu4=pNQ#~EBO7B6pmQF6rZ)0WA4wB?P%6pPMXDf&TrPr6ifLZE-BsDv#tWGv*Mjl9U!%Q&Syy;HUmndS#6bf#GwxZW@eA9)-4P!Qb-}xhM#BP) zi({uA;MV08rKcIaG+Z%6uB`XgJM$RpvGUCPwB5k-DfYSikCgtu%VrL+y7eJq~Y* zk+Z&glJU!?VCI5<6X{TCD(9TQ`Uv=E(El$^8PdmD$+^@$2zw|~bc%F076@t0!DipT zg|j?Cgq#~VqvTS6=eKTRA6hGQ8{fYbZJz36oy?`ZH&h&LEVv1;&yUi6L0*-VEZAED=7wv!wcSC z*#}E?#hZ+v{dU5o5J+M}fPLjg59G-f*G4Dt1r6<6%d)e9LTTwooU3dj@$XBV?( z_a@x@!8Q`Lv}X0rm$u9T+5`R734*h}{`)`VV!?_4 literal 0 HcmV?d00001 diff --git a/assets/MiniWorker.png b/assets/MiniWorker.png new file mode 100644 index 0000000000000000000000000000000000000000..0bdd8c77f41e0096b5a3410c48657a0d66d62735 GIT binary patch literal 3761 zcmZ`+cUV)&*S?{<(ov}iAPBm2M35q7=}Hr%3I-7ARjRZ^Sp^JDK#G)51Vlk#=|w^{ zC`1S-9fEX-bV3O!zwCa`_owH1X6D|RdCs|W?m6#yC(**pknInFKL7w=Gd9w*q>Wv) zw!p$f>#YO56len|*wXMX;Nv%;4FF*GG1k+$7m>d;XYMIz3t`@^8H9u!Ug?g9nAqLo0oa1|qb4h93bek-Q&t;SRr zS^UZVQm?zuB2ItvCN+}ek`BupRHJ+5~=t=ZI;YC7{H)|bz z0`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H$N9!yfUL3%gLB*oGh& zSn#ISMusZ9n(qB9D&9zbi?mb=fhu>5A=!3RZ#>*ve!O+MWr-V}F59YA9zpEzK=b(M z(|#RgsMgIhzRY7oK|@84-;XMEd2Z1lduuc-=L-iz(DIq}gq`vy%$8)mE4X^meGIYI zaf&^5cw>vMmQqvk&zcB4L!3?5Z}|CXB9%Agjkuu195@1_6)st+=hHU*E=&KLZyPB8sKfNi%<6|o zoRLadfz7vNuDc>XFGqyE8OViu2#dkTsDB?4jYV#0U8}@11jGdArys;5Lx_ zrwR9*J&nu@wD-2xCp@>eJ8pn-=dP=0ZxqdnlrFE-*@Z9(SSQp2&hCbZFBUt=_P0p6 zYu|eq>w;$$M)^wX?xU;G)y2cFf^}EWnXzBVpk?r_Ki{NRMHzO4^!H9ZMclE~$mH#0 zfOlqpf8?K|7SC!-hFqtJxw1y8N47X`twPt8ESoyJLgZrP8Q4(kgYHYj0s% z*0AppC$Oyk2sjW!O7&-;!eU-&eu9S9B^HSd&D$u8HX0&O94XRF+AUjvU`Sut ztZ>nB=x$;34t?$XLmse0NhA6e`d-YFHNhqTi6S{gkw5$2Itr%lR}2DhsM5G(3I7qy Y0TRU)KD#JHyMqG8`eu3`|8jozKRkRu_5c6? literal 0 HcmV?d00001 diff --git a/game.py b/game.py index 404be86..aeeef07 100644 --- a/game.py +++ b/game.py @@ -2,6 +2,7 @@ import pygame import math import csv +import random # pygame setup pygame.init() @@ -13,6 +14,121 @@ dt = 0 player_sprite = pygame.Rect(100,100,50,50) mur = pygame.Rect(500,100,100,100) +class Waypoint: + def __init__(self, name: str) -> None: + self.name = name + match name.capitalize(): + case "A": + self.x = 800 + self.y = 900 + self.connection = ("B", "H") + case "B": + self.x = 1575 + self.y = 900 + self.connection = ("A", "E", "C") + case "C": + self.x = 2500 + self.y = 900 + self.connection = ("B", "D") + case "D": + self.x = 2500 + self.y = 1600 + self.connection = ("C", "E", "F") + case "E": + self.x = 1575 + self.y = 1600 + self.connection = ("B", "D", "G") + case "F": + self.x = 2500 + self.y = 2200 + self.connection = ("D", "G") + case "G": + self.x = 1575 + self.y = 2200 + self.connection = ("H", "E", "F") + case "H": + self.x = 800 + self.y = 2200 + self.connection = ("A", "G") + + def get_new_connected(self)-> object: + letter = random.choice(self.connection) + return Waypoint(letter) + + def get_direction(self, pointA: object, pointB: object)-> str: + a = pointA.name + b = pointB.name + if (a == "H" and b == "A") or (a == "G" and b == "E") or (a == "E" and b == "B") or (a == "F" and b == "D") or (a == "D" and b == "C"): + return "north" + elif (a == "A" and b == "H") or (a == "E" and b == "G") or (a == "B" and b == "E") or (a == "D" and b == "F") or (a == "C" and b == "D"): + return "south" + elif (a == "A" and b == "B") or (a == "B" and b == "C") or (a == "E" and b == "D") or (a == "H" and b == "G") or (a == "G" and b == "F"): + return "east" + elif (a == "B" and b == "A") or (a == "C" and b == "B") or (a == "D" and b == "E") or (a == "G" and b == "H") or (a == "F" and b == "G"): + return "west" + else: + raise Exception("crash: POINT A and B impossible") + + +class Pnj: + def __init__(self, x: int, y: int, sprite_path: str, direction: str, objectif: Waypoint) -> None: + self.x = x + self.y = y + self.sprite = pygame.transform.scale_by(pygame.image.load(sprite_path), 3.0) + self.direction = direction + self.objectif = objectif + self.speed = 6 + + def avance(self): + ''' + Vérifie que l'objectif n'est pas atteint et avance le pnj dans la direction + ''' + if self.check_objectif(): + return + else: + match self.direction: + case "north": + self.y -= self.speed + case "south": + self.y += self.speed + case "east": + self.x += self.speed + case "west": + self.x -= self.speed + case _: + pass + + def check_objectif(self): + """ + Vérifie que l'objectif n'est pas atteint et renvoie true si un l'est, s'occupe aussi de réassigner un nouvel objectig + """ + match self.direction: + case "north": + if self.y <= self.objectif.y: + new_objectif = self.objectif.get_new_connected() + self.direction = self.objectif.get_direction(self.objectif, new_objectif) + self.objectif = new_objectif + return True + case "south": + if self.y >= self.objectif.y: + new_objectif = self.objectif.get_new_connected() + self.direction = self.objectif.get_direction(self.objectif, new_objectif) + self.objectif = new_objectif + return True + case "east": + if self.x >= self.objectif.x: + new_objectif = self.objectif.get_new_connected() + self.direction = self.objectif.get_direction(self.objectif, new_objectif) + self.objectif = new_objectif + return True + case "west": + if self.x <= self.objectif.x: + new_objectif = self.objectif.get_new_connected() + self.direction = self.objectif.get_direction(self.objectif, new_objectif) + self.objectif = new_objectif + return True + return False + class Player: def __init__(self)-> None: self.x = 800 @@ -81,11 +197,15 @@ class Game: img = pygame.transform.rotozoom(self.perso_sprite, -player.angle-90, 0.2) screen.blit(img, (540-img.get_rect().centerx, 360-img.get_rect().centery)) + def draw_villager(self): + screen.blit(pnj.sprite, (540-player.x + pnj.x - pnj.sprite.get_rect().centerx, 360-player.y + pnj.y - pnj.sprite.get_rect().centery)) + def display_all(self): # fill the screen with a color to wipe away anything from last frame screen.fill("purple") screen.blit(self.map_sprite, (540-player.x, 360-player.y)) + self.draw_villager() self.draw_player() # We display it at the end so it's on top of all @@ -98,6 +218,7 @@ class Game: player = Player() game = Game() +pnj = Pnj(800, 900, "assets/MiniPeasant.png", "south", Waypoint("H")) while running: # poll for events @@ -105,6 +226,7 @@ while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False + pnj.avance() game.check_input()