From 58437a4854bd23e43c4934c65b676129cf7cb03a Mon Sep 17 00:00:00 2001 From: majkellll Date: Mon, 13 Mar 2023 08:49:34 +0100 Subject: [PATCH] changed stick man to dust car, renamed variables --- gameContext.py | 6 +++--- gameEventHandler.py | 4 ++-- imgs/stickMan.jpg | Bin 29310 -> 0 bytes main.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 imgs/stickMan.jpg diff --git a/gameContext.py b/gameContext.py index 927dfd7..a59e292 100644 --- a/gameContext.py +++ b/gameContext.py @@ -4,9 +4,9 @@ class GameContext: dust_car_speed = 20 dust_car_position_x = 0 dust_car_position_y = 0 - stick_man_pygame = None - stick_man_pil = None + dust_car_pygame = None + dust_car_pil = None canvas = None def startup(game_context: GameContext): - game_context.canvas.blit(game_context.stick_man_pygame, (game_context.dust_car_position_x, game_context.dust_car_position_y)) + game_context.canvas.blit(game_context.dust_car_pygame, (game_context.dust_car_position_x, game_context.dust_car_position_y)) diff --git a/gameEventHandler.py b/gameEventHandler.py index 6014365..479fb9e 100644 --- a/gameEventHandler.py +++ b/gameEventHandler.py @@ -8,7 +8,7 @@ def handle_game_event(event, game_context: GameContext): def dust_car_movement(event, game_context:GameContext): if event.type != pygame.KEYDOWN: return - (width, height) = game_context.stick_man_pil.size + (width, height) = game_context.dust_car_pil.size if event.key == pygame.K_LEFT: pygame.draw.rect(game_context.canvas, (0, 0, 0), (game_context.dust_car_position_x, game_context.dust_car_position_y, width, height)) game_context.dust_car_position_x -= game_context.dust_car_speed @@ -21,4 +21,4 @@ def dust_car_movement(event, game_context:GameContext): elif event.key == pygame.K_DOWN: pygame.draw.rect(game_context.canvas, (0, 0, 0), (game_context.dust_car_position_x, game_context.dust_car_position_y, width, height)) game_context.dust_car_position_y += game_context.dust_car_speed - game_context.canvas.blit(game_context.stick_man_pygame, (game_context.dust_car_position_x, game_context.dust_car_position_y)) + game_context.canvas.blit(game_context.dust_car_pygame, (game_context.dust_car_position_x, game_context.dust_car_position_y)) diff --git a/imgs/stickMan.jpg b/imgs/stickMan.jpg deleted file mode 100644 index 8871b54e880aacce984be5ce4990a067c8a98bdb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29310 zcmeHL-EovL3_QA^1S+5a9vEI|h5{&nrh_;qK3SG!SzdD=L7BN5{j8*2$&<HBv3_L{#tuU{|k?&o%UcamOG)4y@kyi?xkSsTc=_pHsY z&CNTl?dw_SywmIE>z|80-zMzY^~a4v{_zhaASKZ)J*W=?WeY=C3jjf1z>teX4A0+ zAj=SBs57jM5=4yFkg5Mgf3UL(Nt>uHv17?o9mHDN@ih@B&G$0bWgk zn@O%CIs!L>#o|y+M8QK=V91SeA64P|NyhzTf#?C75ws?vV^bDcayJ$9hu2sSlEwnjC1r{LlqW%>3VyI8XF?X~Nw`)I?K zcj32J)l|b0!g5#DRCREJ@wUtrO|`w%P|MZAVrY;iCh*m5Kx4c7df-&x+sy$5}S%QA=j;Mv>+nPqQhQ$> zYrF7mvW=Q%D^0&K?HLAuG|~Jks3~i}X>!U6Z{J@C)#Q=orxr${H5DSpI}9`R7oO2X z^GCA$)WXPPnntq1O#Ou?HL0@v)WXQantEAbrvAdzzij!bVK}age4d(RN{XdRV%R0PB-{QN*1D9f<2= zucNj#K@_M>bi$5kYLZJ*_X`Zlc|L#dPC)ue++Gt%eeo#dV- zJ4U4CNQb|1C+dzMZS`;nP#~#EF2&k0A}8nh{JfL0C&W4Q9?CFZXzxxmL+68t`UEJb zZB2({DOBB|)HGZb;;lV;49EBqh&$1w2Oosxqdr7|Gy!D|sk#$5O%Pdb-WCw5X;YTP zb0vq?6qdC@dV)QmDIjY?axr~IQz7B`6}U*(1wW~&66nR%)CuFSXgWdM=$V>~Cq3@UjiV>uT}<()2c41-GE$ym;XQt$IlzX1=L(v$!I diff --git a/main.py b/main.py index c1882ae..0084bd5 100644 --- a/main.py +++ b/main.py @@ -9,11 +9,11 @@ pygame.init() canvas = pygame.display.set_mode((800, 800)) pygame.display.set_caption("Inteligentna śmieciarka") -stick_man_pil = Image.open('imgs/stickMan.jpg') +dust_car_pil = Image.open('imgs/dust_car.png') game_context = GameContext() -game_context.stick_man_pil = stick_man_pil -game_context.stick_man_pygame = pygame.image.frombuffer(stick_man_pil.tobytes(), stick_man_pil.size, 'RGB') +game_context.dust_car_pil = dust_car_pil +game_context.dust_car_pygame = pygame.image.frombuffer(dust_car_pil.tobytes(), dust_car_pil.size, 'RGB') game_context.canvas = canvas startup(game_context)