From 25289562397c10dbdbcfac029ee4c9e775a8ba6e Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Sun, 2 Jan 2022 05:55:56 -0700 Subject: [PATCH] keyboard controls --- level maps/r3 level1.xcf | Bin 92757 -> 92757 bytes r3.py | 71 ++++++++++++++++++++++++++++----------- 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/level maps/r3 level1.xcf b/level maps/r3 level1.xcf index cd8138698855d2cbf6f804c3e96cb144a1dcf582..fe64cade2dd83eb04aa4b4364274d885834d1942 100644 GIT binary patch delta 116 zcmcb5h4tzc)(w@6jA5Ir7!NLBVParln7od$pN(lX0|Vo^$qU=8C$ldWVAPl_*e*P& zot 0: - ay = 0 - if pygame.sprite.collide_rect(player, wall1): - if ax < 0: - ax = 0 - elif pygame.sprite.collide_rect(player, wall2): - if ax > 0: - ax = 0 + #if pygame.sprite.collide_rect(player, wall3): + # if ay < 0: + # ay = 0 + #elif pygame.sprite.collide_rect(player, wall4): + # if ay > 0: + # ay = 0 + #if pygame.sprite.collide_rect(player, wall1): + # if ax < 0: + # ax = 0 + #elif pygame.sprite.collide_rect(player, wall2): + # if ax > 0: + # ax = 0 if pygame.sprite.collide_rect(background, wall3): if by < 0: by = 0 @@ -282,8 +313,8 @@ else: complete = True pygame.mixer.music.stop() lcfx.play() - player.velocity[0] = int(600 * dt * (ax - bx)) - player.velocity[1] = int(600 * dt * (ay - by)) + #player.velocity[0] = int(600 * dt * (ax - bx)) + #player.velocity[1] = int(600 * dt * (ay - by)) css1.velocity[0] = int(-600 * dt * bx) css1.velocity[1] = int(-600 * dt * by) css2.velocity = css1.velocity @@ -313,8 +344,8 @@ else: csfx.play() elif b3: #this restart the game - player = Player(12,190) - css1 = Css(400,190) + player = Player(346,206) + css1 = Css(483,262) css2 = Css(500,400) sat1 = Sat(550,-100) sat2 = Sat(600,100)