From 84abac95e789ed5e6512fa642e3b40f1526c7ed7 Mon Sep 17 00:00:00 2001 From: s450026 Date: Sun, 26 Apr 2020 18:26:55 +0200 Subject: [PATCH] Add moving based on directions --- main.py | 7 +++--- resources/images/waiter-down.png | Bin 0 -> 3478 bytes resources/images/waiter-left.png | Bin 0 -> 3431 bytes resources/images/waiter-right.png | Bin 0 -> 3484 bytes resources/images/waiter-up.png | Bin 0 -> 3450 bytes src/__pycache__/graphics.cpython-37.pyc | Bin 0 -> 2222 bytes src/__pycache__/matrix.cpython-37.pyc | Bin 0 -> 1878 bytes src/__pycache__/tile.cpython-37.pyc | Bin 0 -> 602 bytes src/__pycache__/waiter.cpython-37.pyc | Bin 0 -> 1560 bytes src/graphics.py | 14 ++++++++++- src/waiter.py | 31 ++++++++++++++++++++---- 11 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 resources/images/waiter-down.png create mode 100644 resources/images/waiter-left.png create mode 100644 resources/images/waiter-right.png create mode 100644 resources/images/waiter-up.png create mode 100644 src/__pycache__/graphics.cpython-37.pyc create mode 100644 src/__pycache__/matrix.cpython-37.pyc create mode 100644 src/__pycache__/tile.cpython-37.pyc create mode 100644 src/__pycache__/waiter.cpython-37.pyc diff --git a/main.py b/main.py index 016ffe0..32f4ea2 100644 --- a/main.py +++ b/main.py @@ -10,10 +10,11 @@ if __name__ == "__main__": fps = 40 graphics = Graphics() waiter = Waiter(graphics) + direction = 0 # init functions graphics.drawBackground(waiter.matrix) - graphics.update(waiter.X, waiter.Y) + graphics.update(waiter.X, waiter.Y, waiter.direction) while True: for event in pygame.event.get(): @@ -29,7 +30,7 @@ if __name__ == "__main__": break graphics.clear(waiter.X, waiter.Y) - waiter.update(event, graphics) - graphics.update(waiter.X, waiter.Y) + waiter.update(event, graphics, direction) + graphics.update(waiter.X, waiter.Y, waiter.direction) pygame.display.flip() clock.tick(fps) diff --git a/resources/images/waiter-down.png b/resources/images/waiter-down.png new file mode 100644 index 0000000000000000000000000000000000000000..1dfcda9cd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A@*76GxKHLktGSxyp$f1BkOTtoGK#6^eq$ajjyp zGqFBTj>GYHUU4x=EVtveWF~rsh`;?~w28$+h17X)Pu4hFny+Vvv3FpvU37f6qRrE* z{U~6aB?D>1AwQm%aGwSrAY&Bk+aWMZ&p7@(w0zm6Zjzjb-kLwTHZo#lqwToUQ9lDO z2+2^u!!~o4$JE>)@_wE1!P_z21*@7b8}MB6SKddd%tM)_(~M4g z8&6G?Fl<}S&CApmGZ!_4*BEeJSqB*+saOj8^vOpblCRB->Z*)SUWlvP6*)KQD)(3V zJaQ75y7|}_dT0rb){!For`LHcFCWw(N^uLId)2nVchS6Yo+LD<$7+A1rHW_w@%dhJ zvF;Jk_!Ve?W3EzrR-XIdDV_JvescD$C$t{T|M?Fh@W3-#f!lhSw8;Rmf1i!+T|;=i Irft;!0Oin%`~Uy| literal 0 HcmV?d00001 diff --git a/resources/images/waiter-up.png b/resources/images/waiter-up.png new file mode 100644 index 0000000000000000000000000000000000000000..4961d84fc4cb7027c4ca8ebf763cd4e8d8b5860d GIT binary patch literal 3450 zcmV-=4TbWFP)Hg1+lHrgWSWcKdPn90sKGrRqvPeo9CG3uKX#J{(IASm?@+di}}l?o-=)F3E6 zwD^Ni=!>T7nL9I?X}YoAW$t|Qo$sD|?zw001?ah|SeB6#0T!CBEf+H4bBB+JJu8re zhoBb*p;u8ID_yBf0ya+zcePvJL&AGs+11_tpRKn>9TgyPA7ZoSs0)aX0r00)%XR^J z`jH<$>RKN5V(7OqK*TS4xZz{h!*f1C3ECFkK$#7nA@pGN!$;%jYv zwjAKwmYb0gKL(K8-kPtb5${A?tlI~wzMrJ6wTdBr=Y%%%EaEMQ&o}4FQ^DA)s*}Z> z!FI&AHCpoWI|RUqx?7s@$8!5^Q=anY%X@i5{QA6kNcMelpE>R6eCYFpmMsVT zrI(b06~u#xf1yS}_UGdMvD``!0~u->P=lA4?YN`hilQ z|3tHka)7T{2CGqwjZfMwx$5irQN_*|e4l)UHmiYuz74Yp1t^#>hrJ3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FhxxSP_s^EWTbFa$0UEYvy?GXh{Qg zVI2e76c#21Fz(*KfVqZgUlV?Kqe!BkR8dt!W!kNll@>UcMa+t2cIc@&FxS0t@X;_q*s zQ?=D$x{!gHsYy&EbaV|&p;{Zk?$$kgDY9G%{eBMeWD~s^U?Z;K;>&GzB|27)#s6uD&EdKGv5ax7Vh!mubwH6B$f)(EU zAC8HL?!h~wBW0bp5@E_F{G)?kRKZ{nSECbXKYbB#zCEPAr6E`}vQ+0wFe5iK!Ns`I zTpkQx{Xesa#a-^Fb??I}7VThG%@zrgy<)K#FUk1LluSXKZZ8H0u9U5~{4*Epmt3M0 z5*fMtI^W{iSdh8wEpAvTH@lYBppa`Rgq*W#K`H{Fo0=yDQ39AmTirEw{m*}H|E!}Q??*?ZEsfcz)2?gj|bLOqIoInB|dC0`4GDQp+oj? zP1~F5Eb*8->g$z@#dSD``urweksOa#m1M1=A`b zNG4-g!ESq-nY$44_pMdGY;6TYAwG_{U9NH)3aH6YYO?LSKaY#A{jp%y-n8DXYhYai c{|ycN2U{jIK@wqO>;M1&07*qoM6N<$f(q+!7ytkO literal 0 HcmV?d00001 diff --git a/src/__pycache__/graphics.cpython-37.pyc b/src/__pycache__/graphics.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a06bfb5921f166aa081c7fd4c44b82c15d6aeb64 GIT binary patch literal 2222 zcmai0&2HO95Z>jVC|P#mG)3y74O%2Xqr#O82k0pX0@py$9&~6>I3UmxGx%G$amrNtnj;Yr^!mnnM|VMOwxj^rY(}T{aDb7trM)5KaI| z9F0+?T@y!VIx~P9%w!gDlhv3F++uaG*2wLb!b|#rFMSG&u_1pC`d859KR{A4pf_Oe zXS$HI4U)cf&M38JDOsgdDR(ou+ywa{otp3yfjJT9Ffa+`qsKJ^*O*pxAQ=5^2 z4&A&@7LswFTz~~Y*o;6tcDvcf?RH0S8IOd|WhWSVJzy7M9E17W$sZ;Mff#M}sDkL8W?F!nE98Du=S`W)kw zo8y3`{k+BknS|cdu_aI4Vaxy_eZhIuqPZb?c<~z%`(XRulg@XN3)vZZlVH?2LccNa zSulD)W;nLsfoKJX=b=$@_0bu*YMznFw-sBbVC#9s)=|~gjKXu%XR!KKn|-kP`V5L4 zJUp!{umZO1+!S8a;Q4>9;7IpCcI^cy9ls`UMhk~PNzAY zs4Nxa9xC^k@Wv;ef7ui9C}Iy`PT~fH-i7Z_Lz+D(W4ey^@nG1HThLWxpMU@nA~#Sx z22dQqOO*6QL5XtRyy0TS8HFe}UH59_g@s1oZ?QN) yf`1LfCrDN|L`k@#K>yJhX#=sTePGvZUCp*MfpbdUv^2M$6?;F&n5s)=>;C~Au_C+x literal 0 HcmV?d00001 diff --git a/src/__pycache__/matrix.cpython-37.pyc b/src/__pycache__/matrix.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01dd6073cde5415b165bc9beb35f09f17263aa01 GIT binary patch literal 1878 zcmbVNOK%%D5a#SlYguv~CkX6AdnsUai$ZdYoC3ix9HS2u^~DWb2ylt@axJa0+LcHO zmW9>Hx#rM&56+JVB3zb9c zs)HhCT@VZpfw11Nt}Sfg;OGcfcsRPECVU({u_o#`*2KDK;OL7cUb11lA3`mYX+$=u z(MWE-#9q4DV+G^bZ=ry9=qhSfr3r=>;3Tk(H!O{qEfs4n;>&Q7YQFgPboHBzl@2E| z%yeKGN5$!-@q02H^^-{b!Q>iV`u?!}O2tyOhv77tw2x!;TIZwoRJ2cLdJ@gDkbjry zI8AzS77aqazqh~FRx-l<6i91yZG6s?EYY016oiL@fd_S%eNqM6TCU$kjfrBkxs1Ax z%5+z=0tRpc$LxH2ZWU}`-P!_rh{C{m!U&0R;^&-5!267QndZ3+pzG@EQOpC+xCm1(Httm-bYGH(#tTQII1|R} z$4RfRB_%6xWDN)D(*~FtxGrI=1W{2^V5F#$n6L@k)+Wl?&H|0q1XUp3;X;`a)(ZORfN;i0H_Ur@T+_SgUN%JU7)d4EY)3cz} zYU7rCBBNNfRWh8Up-%E_Rp-xIda7juFEP$ln5M?n;YAu7`y!NP4FxZWVBDx5CenCU zVWMLh)C_O~X9i9U92xl9!1o4zLY6o=GD0@dp4=d@NrGZ1857i2$l+4>s#{an!;3ss z@)7OYLeX_p(#swIBkA4Hs@g`uV9T=L{^#37p$5!8{a2hKDkaotB(F*$k&l>cd|;St zd=vwy3W-&*+@Ti`*p=sZPCjrC>ju^u+W9$JE3?M#ANX?Zqwa5DUS4y2bNQs#|1Upe zfYZt#}{rD1nAYYbHJh}5@#mY&rM%6J3hcV}-&iODGla%xZ z=i^D3Rx5HH4V87HWP$vGres{wEi0Lzf-R}6NJ=o(C`Huv!FPS%f8^V~U9RAtMAye6 a-O~79R?(9Ve8`gVJC#!h^ybTG8umYw8lZ6i literal 0 HcmV?d00001 diff --git a/src/__pycache__/tile.cpython-37.pyc b/src/__pycache__/tile.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..465e2fba9924353998479635467a83769e265bb0 GIT binary patch literal 602 zcmYjOu};G<5Is9-iK+%9#LS+BRGk%bcoXK{3Y( zh_pDZ>)xE|K^^)3Q46`ZqTS$j>x?#Po&dbT-q89lJkNh{8Q7NL<6K&A%$04WQ=X|G zl%T$+d0R>wzHpOHnVG7xnoMmMJLkJBIpC?u%7Q8RTxCj%h+1FE{0XOGFZ%=);;i4Z z_+Cq;;{|`ss`yIkxha?NtB6M{Q>Ckdvzx-mJe$ZOopILh^?R{aX>3raljWNY7|V*x zFy6jkoxE@RIX&$nOH0nV(i k*?@glb27M>(GCJq=fh}wHn{E&m20rUV7ub1?!pTE0XtufBme*a literal 0 HcmV?d00001 diff --git a/src/__pycache__/waiter.cpython-37.pyc b/src/__pycache__/waiter.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19e2854ded20a78f8d5160ddb4685d80674c7ec0 GIT binary patch literal 1560 zcmZux&5j#I5bmFu_SkFh!X-f*5aNJj39X|X0zxQS$Sz5=!9;AL5FaucxhM9F?Xl?@ zXV=!8k|@fBci25};KYFokHNVQ9N^?v-~wOu*vN~vN7Y^ZRdrQORds*WYBdYBl_>>7^Kh&ULSXf{mx zIeD8c2GJz8DxVp+wd$l=gD_08qzFUHzqkCUt?R_Z{UVuW)_-nr!cbgRP2A77h4u1y z{M=ANe`aP6%ijl`$9Zh>&LlcZ=AFYh9~IMC=S+7_mc_ik%%bpqR>b3E5NG`~3UA)H zd83n?e&^Kv|Nd-Y0+=Dno0u5i|YEBSSZBpY$_ zVJTB&<~`zHW*%qRGp8d;@t@8ibmS$S&tb(o_cyk%I{gcw#YmW!C9IQ|Pf@OrxgF$g zC$_V{awSlvj>xQkn&@I^s6DM3#>rqL#k3%MW=jsYB57=n#%}Hao!D!nt((|DE}f zG1JrQ(8^th@?~@F#|f@3#GlSl$_g|t()CBlQwiP!|53@#(YVygYg7UK%%NfntpV*i zRBoXGQ0-7}3#|kF9VKdL3GOZAJ9ODfaUtP_aEjvG;ZplsI7Rf^T3>GAys`*8YNKB? zVW|b$eT9d@C9u|AQU9$dF@_4VqKoUU-Rd8V_MY{M#Vj_|p|*B>^z`uCCtWK?@xrR( z@WIj7j|^oNqVT)>ckey2-f{T&A<3K~;FE`6-Z`oYbB#28T-U5{{p1>H(=C4dA_h+3 zTvM;8NBGs Y&>5$8l~o&jQH6Dz?p{tA2}INT7mo!@q5uE@ literal 0 HcmV?d00001 diff --git a/src/graphics.py b/src/graphics.py index 6424701..8e67265 100644 --- a/src/graphics.py +++ b/src/graphics.py @@ -10,6 +10,10 @@ class Graphics: 'bar_floor': pygame.image.load('../resources/images/waiter.png'), # 'table': pygame.image.load('../resources/images/table3.png'), 'waiter': pygame.image.load('../resources/images/waiter.png'), + 'waiter-down': pygame.image.load('../resources/images/waiter-down.png'), + 'waiter-left': pygame.image.load('../resources/images/waiter-left.png'), + 'waiter-right': pygame.image.load('../resources/images/waiter-right.png'), + 'waiter-up': pygame.image.load('../resources/images/waiter-up.png'), 'table2': pygame.image.load('../resources/images/table2.png'), 'table3': pygame.image.load('../resources/images/table3.png'), 'chair': pygame.image.load('../resources/images/waiter.png'), @@ -35,5 +39,13 @@ class Graphics: def clear(self, x, y): self.screen.blit(self.image['floor'], (x * self.block_size, y * self.block_size)) - def update(self, x, y): + def update(self, x, y, direction): + if direction == 1: + self.screen.blit(self.image['waiter-up'], (x * self.block_size, y * self.block_size)) + if direction == 2: + self.screen.blit(self.image['waiter-right'], (x * self.block_size, y * self.block_size)) + if direction == 3: + self.screen.blit(self.image['waiter-down'], (x * self.block_size, y * self.block_size)) + if direction == 4: + self.screen.blit(self.image['waiter-left'], (x * self.block_size, y * self.block_size)) self.screen.blit(self.image['waiter'], (x * self.block_size, y * self.block_size)) diff --git a/src/waiter.py b/src/waiter.py index b6e1de5..e43e456 100644 --- a/src/waiter.py +++ b/src/waiter.py @@ -9,6 +9,7 @@ class Waiter(pygame.sprite.Sprite): pygame.sprite.Sprite.__init__(self) self.X = 0 self.Y = 0 + self.direction = 0 self.frame = 0 self.matrix = Matrix(graphics=graphics) @@ -19,14 +20,34 @@ class Waiter(pygame.sprite.Sprite): self.X += x self.Y += y - def update(self, event, graphics): + def arrow(self, direction): + self.direction = direction + + def update(self, event, graphics, direction): if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: - self.move(-1, 0, graphics) + self.arrow(4) + #self.move(-1, 0, graphics) if event.key == pygame.K_RIGHT: - self.move(1, 0, graphics) + self.arrow(2) + #self.move(1, 0, graphics) if event.key == pygame.K_UP: - self.move(0, -1, graphics) + self.arrow(1) + #self.move(0, -1, graphics) if event.key == pygame.K_DOWN: - self.move(0, 1, graphics) + self.arrow(3) + #self.move(0, 1, graphics) + if event.key == pygame.K_SPACE: + #up + if self.direction == 1: + self.move(0, -1, graphics) + #righ + if self.direction == 2: + self.move(1, 0, graphics) + #down + if self.direction == 3: + self.move(0, 1, graphics) + #left + if self.direction == 4: + self.move(-1, 0, graphics) print(self.X, self.Y)