From a7a5d7fc0e820ec16aa4e71fdc1558c218fbc86f Mon Sep 17 00:00:00 2001 From: Arthur 'Grizzly' Grisel-Davy Date: Thu, 2 Apr 2020 22:53:25 -0400 Subject: [PATCH] add diagonal directions --- asset/asset.svg | 427 +++++++++++++++--- asset/missile.png | Bin 355 -> 0 bytes asset/perso1_down_left.png | Bin 0 -> 655 bytes asset/perso1_down_right.png | Bin 0 -> 586 bytes asset/perso1_up_left.png | Bin 0 -> 624 bytes asset/perso1_up_right.png | Bin 0 -> 657 bytes asset/perso2_down_left.png | Bin 0 -> 630 bytes asset/perso2_down_right.png | Bin 0 -> 576 bytes asset/perso2_up_left.png | Bin 0 -> 619 bytes asset/perso2_up_right.png | Bin 0 -> 633 bytes ...ojectile_down.png => projectile1_down.png} | Bin asset/projectile1_down_left.png | Bin 0 -> 569 bytes asset/projectile1_down_right.png | Bin 0 -> 580 bytes ...ojectile_left.png => projectile1_left.png} | Bin ...ectile_right.png => projectile1_right.png} | Bin .../{projectile_up.png => projectile1_up.png} | Bin asset/projectile1_up_left.png | Bin 0 -> 566 bytes asset/projectile1_up_right.png | Bin 0 -> 586 bytes asset/projectile2_down.png | Bin 0 -> 405 bytes asset/projectile2_down_left.png | Bin 0 -> 456 bytes asset/projectile2_down_right.png | Bin 0 -> 456 bytes asset/projectile2_left.png | Bin 0 -> 403 bytes asset/projectile2_right.png | Bin 0 -> 405 bytes asset/projectile2_up.png | Bin 0 -> 397 bytes asset/projectile2_up_left.png | Bin 0 -> 448 bytes asset/projectile2_up_right.png | Bin 0 -> 454 bytes models.py | 81 ++-- 27 files changed, 422 insertions(+), 86 deletions(-) delete mode 100644 asset/missile.png create mode 100644 asset/perso1_down_left.png create mode 100644 asset/perso1_down_right.png create mode 100644 asset/perso1_up_left.png create mode 100644 asset/perso1_up_right.png create mode 100644 asset/perso2_down_left.png create mode 100644 asset/perso2_down_right.png create mode 100644 asset/perso2_up_left.png create mode 100644 asset/perso2_up_right.png rename asset/{projectile_down.png => projectile1_down.png} (100%) create mode 100644 asset/projectile1_down_left.png create mode 100644 asset/projectile1_down_right.png rename asset/{projectile_left.png => projectile1_left.png} (100%) rename asset/{projectile_right.png => projectile1_right.png} (100%) rename asset/{projectile_up.png => projectile1_up.png} (100%) create mode 100644 asset/projectile1_up_left.png create mode 100644 asset/projectile1_up_right.png create mode 100644 asset/projectile2_down.png create mode 100644 asset/projectile2_down_left.png create mode 100644 asset/projectile2_down_right.png create mode 100644 asset/projectile2_left.png create mode 100644 asset/projectile2_right.png create mode 100644 asset/projectile2_up.png create mode 100644 asset/projectile2_up_left.png create mode 100644 asset/projectile2_up_right.png diff --git a/asset/asset.svg b/asset/asset.svg index e2196d8..3ddc98a 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="22.4" - inkscape:cx="-1033.5604" - inkscape:cy="234.95109" + inkscape:zoom="2.8" + inkscape:cx="-787.46383" + inkscape:cy="200.5935" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -87,8 +87,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id="rect102" + style="opacity:1;fill:#5555ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.22474444;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - - + + + + + + + + diff --git a/asset/missile.png b/asset/missile.png deleted file mode 100644 index 7400f32c65a091378fff91b60682dd3cb4deddb3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 355 zcmeAS@N?(olHy`uVBq!ia0vp^Ahsa~8<2e5Z*dt&u@pObhHwBu4M$1`kk47*5n0T@ zz;^_M8K-LVNdpBXOI#yLg7ec#$`gxH8OqDc^)mCai<1)zQuXqS(r3T3kpe1u;OXKR zV$u6{>OtNn1Ch4Rg`qJiKla`&G zzdkoGX z#oI?#z3F|-E|9P^J*PQT)iX)S!SJ~K5B7SI5Vgl_I_W!RyA}2c%rjM!TcdQq>vAC@ z*8*M!-GC2E!fKPsrbt|qi&(`hU2t6ZUFnG!gDcsp2RB~d9n0$f>OiXYIg6QVYuKKC wUzox0@sQ_*f}=+oX0_?D)m-R!bNdx*KfBA6&^_%IK)*70y85}Sb4q9e06>I_82|tP diff --git a/asset/perso1_down_left.png b/asset/perso1_down_left.png new file mode 100644 index 0000000000000000000000000000000000000000..7d87b18e6191dddee59268d751d5dcec7e89498c GIT binary patch literal 655 zcmV;A0&x9_P)Dx`3LZHyIS6Zw}*Hj_Eex>;_y#JD-^+Zq?(w0bqO#p2|+A^)NEulV0TdEbd z1vCU{%SB@&p)p8XG71|3ZG*IBgRz0o6i8b-2pa%RiL~Xtv7XQ_ke1+u^?-JXw2YajJ@K9DAEtOMF7(qs`^f#!fT`5#+?=7cnP#Ll5PB28vkl{eBv zjn_cm_sv)yeLw%}CnHd~t{ern4oZV5ORT`w0W3^USz*N>!8ze)ft4~6YHy*vVx@|N z#)pz#u;M}jtkr!(?`=Ol-~Kx7jIH+cR0c6$2z?VuZ*jWi*_ z0X0bTeg#-rhJ*@Kf94IElj?^y*6#+J&;I^8`!jr*5D1<~sPs|wgDVuyC+wZU^}ED< zR(z3AGwSsxMrfQP{^H-O>Bq^pVI$ov2R002ovPDHLkV1f%lAG`nn literal 0 HcmV?d00001 diff --git a/asset/perso1_down_right.png b/asset/perso1_down_right.png new file mode 100644 index 0000000000000000000000000000000000000000..be786c7501e5a88d7f713fbef7324e0e237dcd64 GIT binary patch literal 586 zcmV-Q0=4~#P)wZ#zcytTKbSeq)KIeqAdP zL^g7Ru&O!Z)UcgM5ZfAW#VX&ls24mI8-7D72!3pEVwDd$a(2th=bI|?b=c`!lag-r Y4`5BPS_K!BtN;K207*qoM6N<$f}WE2Qvd(} literal 0 HcmV?d00001 diff --git a/asset/perso1_up_left.png b/asset/perso1_up_left.png new file mode 100644 index 0000000000000000000000000000000000000000..3c17bba54aa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!hZv&LxVge zFFFe`pyxNvRwI^y*G2et}0DHsW0Tp!w)1=jsC_U}Ko-@kFvR`*mRBzU0EE4DEb zN{2q5Nm=?%gI6#4VR5gksTC67S=CCDva~Uj_H1Hq9=~h_nDF=Yt&vc1==0@HgA6IH zU=e`rgoHpSfc?ygxpiOlHQ3HbXaKFtgH=I-;=dw}2N^YFFQt$?{a{q>0e0fP1cidi Qy8r+H07*qoM6N<$f)wEbng9R* literal 0 HcmV?d00001 diff --git a/asset/perso2_down_right.png b/asset/perso2_down_right.png new file mode 100644 index 0000000000000000000000000000000000000000..055575712f5b3e6e6f20428891a01ff7ab59225d GIT binary patch literal 576 zcmV-G0>Ax2lnJnKhvu`H=%4Lx5;YEAhM02qWQs5c5x`*i-d}^(& z1}z~aRjdlsf|S&-ouLg#Nd?;p8i15KV_QQbkWwdXD`*R()EXNN?SPb8VWXf5NGTc{ z3{^x*QP?184@fB(>xK4+l!CC0&@&(3VB`3B99S|v5u@&eDkWvj> zKu3g>D%b=@iIfVg88NcRz;=?uX=sSA98SqQeBZ&3f%(uNN9hVS3BZW4=?XSb+VvyE z7D)IvM@NLMAi;7njR0Fig5#_o5NkyOOk8(7!ZwGe{!G;tbB+&7rmpM8x4;h8riUNB z$}Q#`XBXT6kh3+1`WNJdLciDwQnFx!pwJK2ij*eYnjJ@Z8T=Hgy}=rhkeZCw@*7dl z^;%djavwOJn(B&egM^0h)KrJjmCi2ta9wjDA!0MxiriquFwa-4$t(9YBB3J`g0Zy| zr-bz)K>-S0tn*mRmt30zUm>5N0tF}5iHuF{UlGeRP($`o2I=1eqiVle+O?P1L7062 O0000g{4Oz90Lkx)&i3uWOtL@ypa9cY<7PG*|+cl!dXDPglFk_hmw;mAO@a*iyJt5 zgG6d>G3Ws@k0^G~bfCKD(sWIO+}{IJsmGuZRE>#=NY#CHQ4_MbR|p%`4N&7Fh+-bC zcx-|^T4+9If1gjR&5VfNEo>; zbPz9W1==w(k2AIeRS%3%yy^z7GrkfTWF9AMsXRq5q(s$+eUp)XCgwWo8<*0h-Suk1 z6t$l~@awiAYO8^oR_ zwAd0f0A!vDwtxnN%u~V+AxLDN0viR4EE2(dpkUiKq%I1!!*}?;hFt_#eS-{%ComfV z1dNR*FoT0#A0W0s!ciR!2wOse=41*0TS0>1tnU%4MS|tmQx8}p5^7pHC&XHj(4hBp z0&Fc38aBx~#5O{LLpQGjY-1!iwjBkrPDt?Rj|yO&k>J_LZGrVdLW_>G2i6-2EnDLb z*j7jo=;1fOwnl=`%LWTp1POv~MKoA3WG7ib{QrkhG=Inh*j_nr=+yuK002ovPDHLk FV1gAp{C5BV literal 0 HcmV?d00001 diff --git a/asset/perso2_up_right.png b/asset/perso2_up_right.png new file mode 100644 index 0000000000000000000000000000000000000000..1bf335ba32c0a1ccb7095096e5cd0b9e85cff7b0 GIT binary patch literal 633 zcmV-<0*3vGP)*!ax{@;dfwVqS2shL!!|`XafFO8gBs}0e9A& z+(2|;JcBM>z=A{Q1~>)m>H?-IW!g@sUul0k7&`N$Ogq!BAe;esZ}1}BZ(Xvp0eHX@ zaCr|qU+^QnN4X%u%3G3Ir_UqXwgWW*_7tNKI2A%4-*m+=IFMN;e;23XpCpH z4CE@Y8<`DgiAWtIb`4qqq|OF5fK~{pvxcohC6PJ-R#g}oL_xpi!@O)rT6~z-zhQg_ z3kA1jgJR-6z;hj-!dUNt8H^SR)b=ws|FB zW08=uAKfB05eXJM{4HQpkzo1ER3O$02^p$+1z@d_kg@D2h|Poqhx(`hHZu|&3%NP4 zPDsd6adyBuBOzyLJOeft5(H}a7TDZK5PI2=fE7W4;9C&`Rt#B42H>q87)A3BE%d{( T!f=>g00000NkvXXu0mjf1>pj% literal 0 HcmV?d00001 diff --git a/asset/projectile_down.png b/asset/projectile1_down.png similarity index 100% rename from asset/projectile_down.png rename to asset/projectile1_down.png diff --git a/asset/projectile1_down_left.png b/asset/projectile1_down_left.png new file mode 100644 index 0000000000000000000000000000000000000000..2cf032abad01d753cfca3eccf015d0107d8bbcd2 G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*GDyyVv^W3n%e~4o7_OaG>F$~rF)|n;3o%Qv1Z3y7t;1AVmIRm^XmE`g{ z2u$wn{p@rG09#vM+1&gxqBYN#mc(j>$6A}N5TIHu6URHV8yh@mg`cw7+<&2EWk`|; z5te;lrU5Lacse##kio%`uCUo`ptX%sJPZQ$0l*3Z^~Sc%Vxe#=9UZ;W5o+y_Brzh~ zpP!fBvsDR0wPIPB>4}M}->0VLaGVPma}faBHl*oa9H$3h|L~AmIDLS#JWmFI)p~vZ zMjUTrOfOONi@v@~)M{_Z=jUFR%LCWj;7Ou9k9)vl;1O^aNE(g$w>bV?%4TyngFpox z;7P74d8PP#bc8X6Yin!jmFI~IECVxLVYfU_hD4b82XBj;*SO)V5&!@I07*qoM6N<$ EfEKkwx(SJNTa7MmK#B-Ei-2cbw8#bhWH z1S@yJr6BkR2%`97v0WTQth<|&<_-cXB4|(?%u<3<=w@jJp+88mX+m@n?dxUir!UFX^Q`j_;^#@BwQv%C8P;LIOzb(K4{+RjX+@}@5YU>GLAFAX4{ zSLc*saeu#xrfL5KQ>l{xWeuQEkWV7q)pdg~4EjRD!)YcaE+`Qm>HzceYOvMfR-^F~ zU5^t*?H*`+e45G0T%>8Sn}vdW&;goFW<=PF$B&IhQ5(ZB3Bv%>OrTVUsi{k()2F@z zS3FP3(DeYbvwJVg<>wb|J4d}nP%Cu_)EUeK{y6zq$GCg=L*6 znr7lOFbF&b9su_|k4GS?JG!{8Iu3jU?t7m2j-xII0dEHe2$bTi@5|>Sn{piG9>D*l Y-&LEU;-<{2pa1{>07*qoM6N<$f+6<)Gynhq literal 0 HcmV?d00001 diff --git a/asset/projectile2_down.png b/asset/projectile2_down.png new file mode 100644 index 0000000000000000000000000000000000000000..8b16213063841df23420b0c7e01648e63632f4d5 GIT binary patch literal 405 zcmeAS@N?(olHy`uVBq!ia0vp^Ahr+(8<0%e?(YqxSc;uILpXq-h9ji|$mcBZh%9Dc z;5!1sj8nDwq=ABxC9V-A!TD(=<%vb94CUqJdYO6I#mR{Use1WE>9gP2NHH)l3VFIX zhGO_p{Z=?zFfA)!ZowF2^%eGV{Z4glkmuD(n ze6N(}7(;WROtxnfr{EU%hF+CaXOVRGhPj)QBnmdSbt+y^`P8wK@3T#c#r?xJMsv4z w)TZo=dA=_^_L;&X!$neo-4$A@^O@@yj%v78lumMU1_mL6r>mdKI;Vst0P+o+ZU6uP literal 0 HcmV?d00001 diff --git a/asset/projectile2_down_left.png b/asset/projectile2_down_left.png new file mode 100644 index 0000000000000000000000000000000000000000..03320e4515648768dea8e6fc3a63e6c04e591efb GIT binary patch literal 456 zcmV;(0XP1MP)lNcv~F2YDEnSH=o2@+nXeB7b5dqsNZvio^< zt)y%~DdyP)3tL1#3XHnI&20Zq6P!W_nE{1RzE3wZPs=j~eiwY*`rp!-r)c+Q$e6Fxq!x)B8 y#y!+X18*L(RVXQ8F5zp!uQopuzO!N zcrwf8@;|_`|LP$ah=Dr`d|H|Uo*Y`e8~fNg?Z~Z^-uwipIy8f)e{4j`Uf})};%UQ0 yIEn>a!wJ??HvXzqu#(d(_?q*h;AKW*bpI1fXP)FE}fZs>OQD7MAdi>zErv zh(c~NL`P4`WWPjZAgIO08}$>s4Vpk6E6IY3m|B)vF>(8; z5L@R%An=M~+)xgv_SpR8sL4y6e0K<_uUX7tf~QFuIZgx40vaLWe=tA~9dyaHnF*Pc z)N~e&d6w_~fP`2;A!!dwRKLB)9F;LT1d_*E0=bIW3#tE{3E-054wWYE)9w9l@5f*Y x8Fqd;`36d1t3eXT#q>Ukzl1S8qau%kKpzhnMbbT_BiaA}002ovPDHLkV1kc@oM!+4 literal 0 HcmV?d00001 diff --git a/asset/projectile2_right.png b/asset/projectile2_right.png new file mode 100644 index 0000000000000000000000000000000000000000..70dcad47ae5328a70de9e0b8cd6b2bcf5ef00da3 GIT binary patch literal 405 zcmV;G0c!qK~yM_jnd02gi##E@y}~6k*r*jg^eN1NK!&sS=w0eXUxW0 zE@ADjQ8xSm%0f*{vy_y`)EJk{%==o*$Ygrs**u-j>HE8!ClI3>`a?3vgp4B-w9c(3 zmjTCFP9cZ`71(ZY@Qf;6T3$tjLFABPe}=sd&^5UR8v&c2OrPO3rdT&t(aT!$_hra> zz;3Y#6~?uU4_sl9tz?mrI`a|p6;^JUtKjhu$hRJvw$Sy?TR<7*6i+ECX`;kGAZ>~| zc2r;=JEhiW^*;!sSm3;)aGv{+hXMM>7`{U-2GWCNB*=Fxdx{c{3ZxUvF8TTP?-9gP2NHH)la(TKq zhGblJ zoP&;LiiOzszO)@}@pJ!`*4?k$|NrHL)#s8OCC=(BMC zTF+~fw8i2qtd6br` z0cLqlf0$)lo_srhhqdkYLY22WQ%mvv4FO#tweorVAa literal 0 HcmV?d00001 diff --git a/asset/projectile2_up_left.png b/asset/projectile2_up_left.png new file mode 100644 index 0000000000000000000000000000000000000000..77da10fea4f6c21b12f0c6a85bfe0ca061611239 GIT binary patch literal 448 zcmV;x0YCnUP)PhM-G2m(uI%qBQNI|eX9T4t`o@_%5$^eL;GxVcw+j91hn#w%>yu9ebk z(tQX{5z`j&HKFeg81d|+)gm~;F+(X|(rmSSV!d1d!Y;0u41D+pVteobu!I^SKF5sZ zRu@M|dkern=x7}0^N>nU*=T2Of}7zMV4KD_;nObNxeFDRBPL$(>p99^ZKafA76R8X9|OMwM>~95Crx-?5C;j>lxUwv qfp-uy6G-;xj|%A~+M~admwy4+CRgn(4?zb20000=o97>Z(CqaZdbaL^F zj{XNiNuiFeUHV6K>(HS%DZxQ8P;5l+y_-XI5d{$%l|o`~hil;4-sFtWc@NJy=Y1H1 zj5`@GQu-NxQr=`d81X@sDB;O~t(4#!2DpqS>TESxJ16|e?VL`B=;#a=VHq>rkIF=k zM$F3t>fbAz{Q$+32(Keu4;M1pEyl<5s}4U&gdm z!d$Vj8^RK=bDl;RP7uwaSw!88;RCgR_V0gIs>IjOVi?eF@+yXq6&y`7H^h|U?=Ij3 zH?Y8$6INSvl_Tx5_m;aY^l?d1eH}HPM?7BS$A2~w9(BkM*iHGA@-<;SWstC*S9R8- wk&=z>FyY=iF76N|+#K6f#={ screen_width: - self.posx = screen_width-self.size[0] - self.img = self.img_right - self.direction = (1,0) - if keystate[self.key_up]: - self.posy -= speed - if self.posy < 0: - self.posy = 0 - self.img = self.img_up - self.direction = (0,-1) - 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 - self.direction = (0,1) + + if keystate[self.key_left] or keystate[self.key_right] or keystate[self.key_up] or keystate[self.key_down]: + if keystate[self.key_left]: + self.posx -= speed + if self.posx <0: + self.posx=0 + self.direction[0] = -1 + + if keystate[self.key_right]: + self.posx += speed + if self.posx+self.size[0] > screen_width: + self.posx = screen_width-self.size[0] + self.direction[0] = 1 + + if keystate[self.key_up]: + self.posy -= speed + if self.posy < 0: + self.posy = 0 + self.direction[1] = -1 + + if keystate[self.key_down]: + self.posy += speed + if self.posy+self.size[1] > screen_height: + self.posy = screen_height-self.size[1] + self.direction[1] = 1 + + if not keystate[self.key_left] and not keystate[self.key_right]: + self.direction[0] = 0 + + if not keystate[self.key_up] and not keystate[self.key_down]: + self.direction[1] = 0 if keystate[self.key_fire]: self.fire('fireball','asset/projectile') def draw(self,surface): + # Make all projectiles move or disepear and draw them to_remove = [] for k,proj in enumerate(self.projectiles): if not proj.is_out(surface): @@ -69,8 +85,11 @@ class Perso(): for k in to_remove[::-1]: del self.projectiles[k] + # select img + index = self.img_matrix[self.direction[1]+1,self.direction[0]+1] + self.img = self.imgs[index] surface.blit(self.img,(self.posx,self.posy)) - print("Projectiles for {}: {}".format(self.name,len(self.projectiles))) + #print("Projectiles for {}: {}".format(self.name,len(self.projectiles))) def fire(self,name,texture): if (time()-self.last_fire> 0.2):