From 00d2e73b9eca9fd25a2d36978c202695d6ea9d71 Mon Sep 17 00:00:00 2001 From: Unbewohnte Date: Sat, 8 Aug 2020 09:59:13 +0300 Subject: [PATCH] Fixes and dashes --- player.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/player.py b/player.py index 3bc8f54..7518463 100644 --- a/player.py +++ b/player.py @@ -9,7 +9,6 @@ import sys windowX = 640 windowY = 640 bullets_on_screen = [] -clock = pygame.time.Clock() class Player: def __init__(self): @@ -65,6 +64,18 @@ class Player: print('teleportation cooldown : '+ str(self.tp_cooldown)) keys = pygame.key.get_pressed() - if keys[pygame.K_d] and self.tp_cooldown == 0: - self.y -= 64 + if keys[pygame.K_d] and keys[pygame.K_UP] and self.tp_cooldown == 0: #front-dash + self.y -= self.height*2 + self.tp_cooldown = 100 + + if keys[pygame.K_d] and keys[pygame.K_LEFT] and self.tp_cooldown == 0: #left-dash + self.x -= self.height*2 + self.tp_cooldown = 100 + + if keys[pygame.K_d] and keys[pygame.K_RIGHT] and self.tp_cooldown == 0: #right-dash + self.x += self.height*2 + self.tp_cooldown = 100 + + if keys[pygame.K_d] and keys[pygame.K_DOWN] and self.tp_cooldown == 0: #back-dash + self.y += self.height*2 self.tp_cooldown = 100