From e11835e6defbe679023f9b30e63055e1cadf7fd4 Mon Sep 17 00:00:00 2001 From: pi3c Date: Fri, 8 Dec 2023 23:58:33 +0300 Subject: [PATCH] lesson6_snake updated --- part2_OOP/lesson6/game.py | 70 +++++++++++++++++++++++---- part2_OOP/lesson6/img/body_ld_ur.png | Bin 0 -> 6017 bytes part2_OOP/lesson6/img/body_lu_dr.png | Bin 0 -> 5984 bytes part2_OOP/lesson6/img/body_rd_ul.png | Bin 0 -> 6008 bytes part2_OOP/lesson6/img/body_ru_dl.png | Bin 0 -> 13360 bytes 5 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 part2_OOP/lesson6/img/body_ld_ur.png create mode 100644 part2_OOP/lesson6/img/body_lu_dr.png create mode 100644 part2_OOP/lesson6/img/body_rd_ul.png create mode 100644 part2_OOP/lesson6/img/body_ru_dl.png diff --git a/part2_OOP/lesson6/game.py b/part2_OOP/lesson6/game.py index f85b4c8..81e4777 100644 --- a/part2_OOP/lesson6/game.py +++ b/part2_OOP/lesson6/game.py @@ -1,4 +1,5 @@ import os +import time import pygame as pg pg.init() @@ -17,7 +18,11 @@ snake_head = { } snake_body = { 'h': pg.image.load(os.path.join(os.curdir, 'img', 'body_h.png')), - 'v': pg.image.load(os.path.join(os.curdir, 'img', 'body_v.png')) + 'v': pg.image.load(os.path.join(os.curdir, 'img', 'body_v.png')), + 'ru_dl': pg.image.load(os.path.join(os.curdir, 'img', 'body_ru_dl.png')), + 'rd_ul': pg.image.load(os.path.join(os.curdir, 'img', 'body_rd_ul.png')), + 'lu_dr': pg.image.load(os.path.join(os.curdir, 'img', 'body_lu_dr.png')), + 'ld_ur': pg.image.load(os.path.join(os.curdir, 'img', 'body_ld_ur.png')), } class Snake: @@ -25,52 +30,99 @@ class Snake: self.x = x self.y = y self.direction = 'right' - self.length = 0 - self.speed = 10 # скорость движения змейки чем меньше, тем быстрее + self.direction_prev = 'right' + self.length = 2 + self.speed = 30 # скорость движения змейки чем меньше, тем быстрее self.counter = 0 # Просто счетчик, для регулировки скорости нужен - self.body = [] + self.body = [('h', 60, 300), ('h', 30, 300)] def draw(self, screen): + if len(self.body) > self.length: + self.body.pop() + if self.counter >= self.speed: + + if self.direction == self.direction_prev: + if self.direction in ('right', 'left'): + self.body.insert(0, ('h', self.x, self.y)) + else: + self.body.insert(0, ('v', self.x, self.y)) + elif (self.direction_prev, self.direction) in [('right', 'up'), ('down', 'left')]: + self.body.insert(0, ('ru_dl', self.x, self.y)) + elif (self.direction_prev, self.direction) in [('right', 'down'), ('up', 'left')]: + self.body.insert(0, ('rd_ul', self.x, self.y)) + elif (self.direction_prev, self.direction) in [('left', 'up'), ('down', 'right')]: + self.body.insert(0, ('lu_dr', self.x, self.y)) + elif (self.direction_prev, self.direction) in [('left', 'down'), ('up', 'right')]: + self.body.insert(0, ('ld_ur', self.x, self.y)) + + match self.direction: case 'left': self.x -= 30 if self.x < 0: self.x = 750 + self.direction_prev = 'left' case 'right': self.x += 30 if self.x > 750: self.x = 0 + self.direction_prev = 'right' case 'up': self.y -= 30 if self.y < 0: self.y = 570 + self.direction_prev = 'up' case 'down': self.y += 30 if self.y > 570: self.y = 0 + self.direction_prev = 'down' + + if (self.x, self.y) in [(x[1], x[2]) for x in self.body]: + gameover() self.counter = 0 + self.counter += 1 screen.blit(snake_head[self.direction], (self.x, self.y)) + for el in self.body: + screen.blit(snake_body[el[0]], (el[1], el[2])) -snake =Snake(0, 300) +snake =Snake(90, 300) def update_game_window(): screen.blit(bg, (0,0)) snake.draw(screen) pg.display.update() +def gameover(): + go_font = pg.font.SysFont('monaco', 72) + go_surf = go_font.render('Game over', True, (20, 20, 20)) + go_rect = go_surf.get_rect() + go_rect.midtop = (360, 15) + screen.blit(go_surf, go_rect) + pg.display.flip() + time.sleep(5) + pg.quit() while not done: for event in pg.event.get(): if event.type == pg.QUIT: done = True pressed = pg.key.get_pressed() - if pressed[pg.K_UP]: snake.direction = 'up' - if pressed[pg.K_DOWN]: snake.direction = 'down' - if pressed[pg.K_LEFT]: snake.direction = 'left' - if pressed[pg.K_RIGHT]: snake.direction = 'right' + if pressed[pg.K_UP]: + if snake.direction != 'down': + snake.direction = 'up' + if pressed[pg.K_DOWN]: + if snake.direction != 'up': + snake.direction = 'down' + if pressed[pg.K_LEFT]: + if snake.direction != 'right': + snake.direction = 'left' + if pressed[pg.K_RIGHT]: + if snake.direction != 'left': + snake.direction = 'right' update_game_window() clock.tick(FPS) diff --git a/part2_OOP/lesson6/img/body_ld_ur.png b/part2_OOP/lesson6/img/body_ld_ur.png new file mode 100644 index 0000000000000000000000000000000000000000..7ef46afa51badf468c349fb6884cd7cffee0733c GIT binary patch literal 6017 zcmeHLdpK0<8kgK-M{X&XF-lQ$zYjxdkjs>!Tykm6%o-+UMl*w9yB)g=x~YUjx(QvV zO-i{JoeC*Ygo<*DP)Z4%HEQqboc)~V={aZr*Lt3rwbu9kzTfx0zxRE=XTC{rS!1uJ zvOq;fMn=tHHGMsFHBps*~g99A%xAuoM&ZGgmFH+{sd~u%hHms%@J;r}1QS_07po73Aq-8krI7 zJTEV^C0_iJ#nDQF3(G62GRq6}o*pQFC*coja@!F+(T4B=s8= zDsEYm39k{o*?k>DuPytJWISKhV6AW2dHvReT{Y@8qx#+6rf$K6cH4y|+s2R&C-qC@ ztxc*4GMyJg{qM*JnUSa{=Xa_L*A*WoEzuir_pd8BJm}jH0b7_@lIU?0(uMn zBRY`xK)%y+U@$0Rto_V*|Gg6T1u1Lhv@|Uw>z~?iF-^#bznHk;9rLI{$0<6{wT zBWw(Kwt4nzZ<_0+2SF`Qla}Ap@IGHIWKnsV!caluKAnY=72%rIQ~Z9%lER`Ci0zUEL?D!wj->q6fb4E zMo@!7(ylQ*oacB(Mu=&tNlX+TG&Sq)+an)O?{A%Lc79Dw;JW^$30}PU&kp2`V7qbpQ z3v87@2*U74JQ9ttm2g9`a4Qv2EMJypVSj-jhVNydhX{jaFl-hI3<7x|Uo1jlkeKiAVlL;a-+a**c_E=uQVRq} ze+P$_`;-4Wv;+w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SsQalz)yAXUK!2_NEX?r@%5R3p z(~KIPxj1Vz#ly55(w=0V#Eq7c9-T7RTD3xshnH154rI))zi{D+#pLecdG;&%hR4a5 zNWbA~WQ+kgU3<4_f8j~w)Ojn<7ghIXb@-4gm)uMMcAZG+PN2AWngHTJ@_KqODN676E0-%bKf1nHUal@!&e5oZ zaP96}%_G}Z-eOd#YEyxh71!X1@7TK^n8m@flEU+yoid2G7wZvf&o}hN<9uy=y^jXQOc$v+ z%WJQ`FEKSu4zI6Gi0T{~Ua!MSdf<$mWjk`Z-y-MnGeslwYES$4Q?VYanN|25_iKWe zjy|-C%h2CGIhy}6P#)vaP20>|$Wpj*<1c_rBOq+1cSwimQ8D z-jx(bt$9|4DqWuGH;|lS*l_Egv86{uuTDKIzI4Ck(!{}Np!eoPN#4|}4xd|dYHkFy z@lLDjdmCs*CXcmNt#~Z3j6S}JUwXQARfogU?yLgeWp}uY^9iS0jKXwuL01gn zA+kECx3%DTWcTh7U}*GUy>Uo4<#I)C+=05ZyTbC2w(J-A{ivI7jiM(`#*`Obok;TA z^wEi2w_&c*vhkdc`}bLO9W}^EN%f0v+ByGLq1nF7!6bpdb9U{$-L|Ln49ym|E!~IU zh;Ju4ENC4VNK~A>J)rV3#>+bSkw-nZD+gQ+%E~|fL%(upVOI0aZ?t$^W9Wj&U)bM=5dt$e&yH~j@2UCvSaNU?JQ*b8;n}-kvCqvTdEYNv}n5} zr*60Z`%2$^zMkqC7-X&Y@Ni+1p$1`P+{96>$$}fo$I{&do=G_yTphc(&GI>yKaP!i xF*YbznOAx3)-h*l>{)l)t^2XeIU~fB_2ZK#lH2ZZ^QC{oIoPhD=daux_b<2;aohj^ literal 0 HcmV?d00001 diff --git a/part2_OOP/lesson6/img/body_lu_dr.png b/part2_OOP/lesson6/img/body_lu_dr.png new file mode 100644 index 0000000000000000000000000000000000000000..d896e9de393abe7d4ca844fd45f77aa98f6db4fb GIT binary patch literal 5984 zcmeHLcT`i^_NIw|pcDl`z!0indJlx&CG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HMextE!qK`O^KrG@t!OGi=?qUWC>Hajn^z4q!t ztp~~|Na_Z6l-tva3qPe-J9${IV&Z?;;f+_80NXHnq7<<6wuy-%L_HEo@fxju}FI-7gd zwmfX@!?5^OBVi@Fj+N5ykH)&(ermJ3@dbTZl#PB(uT*b@MMdDm%<;K}`LNMBzd?l5 zzh)P9z34KWsl6EabMDX^+w1R>XRNX^CS>Prua^$lNDozD<1*%#ZSUm^4rw~Sm;CMK N=H%&EZoetz{{ZwdQ854j literal 0 HcmV?d00001 diff --git a/part2_OOP/lesson6/img/body_rd_ul.png b/part2_OOP/lesson6/img/body_rd_ul.png new file mode 100644 index 0000000000000000000000000000000000000000..6758b31c8fe53aba98ef9cf0bfdb80911550e169 GIT binary patch literal 6008 zcmeHLc{r5o`yX56;A=@CX^cvXG5gAJ%AO@fWec;s!&qjfnPJ9~rEg?Okw~^gLJm%) z!#PeNYnw_56)B>l#b~jF{N7RLl;7`Mzw7Gye$Ris*ERFL?{j~i&vW0O`@WxRo=J3e zvQbvlQG`Gs%67JvJHWf1u&`fUKm7X^E=q4IcN*sW9m-IO$)GJX|Dqonb z@vYGxJ^7}xW-i=Bq|}$su&H**nv8##DqdS6@H1h{OP9?i*m}ZIb8yoW(`&EZUauJu zw+iny)%r$n^R>jm@u|5y#jVJ_$NpDfJk zP5g2XN;-kl^gDx*nbYER-aiAf34Nd21!%O|uqhEkY0UHt5A7fNJ=4v0TdU>=ZYuxD zx)u_6v$vXiU-v;)T+w9yjMmkCtwVVp7EI+{gdXXpLh&ft-eP!f@s3oPu+?|s-*hIf zX1G+X+P&Pi{L#^&v-byZlU{}@|F+6u^X=ms&uo8{*%F$Y8Sd?T?2+esw34@)M$Uk9 zgIz#UM2&y9Rq?c262m_3vSCI1C^2el1!q9HG-i2#lve4jeFNFhuAU_+9c9WB8_USf z>4&mMZ^u@j!j<1_Pp?andY)a&+Yo!UW!=(4=bD2d_G6HAYres&ve0G1y?P-69os-v z>BAkGUGd|!rx|P1Bj=+SCv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ZU}TyB{XX&Pgx`-t7><*TAEiJ$co*$ z%IIH;KDh3v3k=tsfrOo_9PA1m_IGktsrM;We?Ud6i|W;S-SyC{W4`eo%?^on+b{e& z5fIbW~p&vx)kWOO*D- zw6#TqDThjBeigBeX%xN(hzD|Mx33IDAZeZf)DOz6O7f zn|0e$&O-uj^YW8l{YdGst!zDkY47NG?$*+^l#x93qMktPpuzdei zHzom!7a})u_#Ij~<8_Vgp;d8zw7hhwnx~J9HCYvVYqeB2b9b_aD|dw*eBxkxL%Hif zj6qltf<8Os`-GVHyt3HE^~a2BDrLrA>NigF%BR(AQAUXctux(~@ajqpO&R{iEYkTk z0z>6Y8^^8kbD^8-aoHT5Hw`b8J=c#~a^o$OA`gV`@7kN*b!X#yw8cF)3ih=i{-t1Y m!=C2yrlq*1<*zm7rQfFyFdrW|O_lsBXJ_SPS-Hh`|Nj8dT5wzd literal 0 HcmV?d00001 diff --git a/part2_OOP/lesson6/img/body_ru_dl.png b/part2_OOP/lesson6/img/body_ru_dl.png new file mode 100644 index 0000000000000000000000000000000000000000..26eba8cc7e910b7148ae29bd58c28b004974b907 GIT binary patch literal 13360 zcmeHtWmFqq_ik`^_Yf#9!QI_MkOFOi0Kq*th2m12;-$D1Em|m2id(T_#ie-hVg<^j z{k?kc{qnAR|KHwZ&1B}BXFq4}XYV8dXk)i+ zF-$tD8CAC+(^b;;cV(y3OahdO0O^cO35fOm>qH5gKtu&AvLGm%;3OQgF?3Ln2_(<|qgv5NI?HHQQ;GOlJPr`SM;u_l?r>$cO; z+pE>P!^fHd%Xjf_FVFLWJ9H#om@chUxBl4oyOQj?&(IyqWxZh-=5qdJv?cOBw|)=y zd8lc^XH7IYG7Q}7#`wd5iIXyEXBunoR6!>o2bSk^lS9fPOV5ZI&c*^ zJ=ttzvY(KDlrhp*c!m9NdH>Z59+X~DP|_UQY{U48K`gs9il)9rS!tq$I(uodz5Uzm zL`!Y4?d0&?_Ap`%j+PXt24{N&wL^JJnu$ZjlHdw*MlN;pw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