@ -30,8 +30,6 @@ class KeyBindings:
elif key == " Space " or key == 1 :
elif key == " Space " or key == 1 :
self . play_sound ( " PUTDOWN.WAV " )
self . play_sound ( " PUTDOWN.WAV " )
self . spawn_bomb ( self . pointer )
self . spawn_bomb ( self . pointer )
elif key == " UpRelease " or key == " DownRelease " or key == " LeftRelease " or key == " RightRelease " :
self . stop_scrolling ( )
elif key == " P " :
elif key == " P " :
self . pause = not self . pause
self . pause = not self . pause
# elif key == "mouse":
# elif key == "mouse":
@ -39,4 +37,26 @@ class KeyBindings:
# self.pointer = adjusted_coords
# self.pointer = adjusted_coords
# self.scroll_cursor()
# self.scroll_cursor()
def key_released ( self , key ) :
def key_released ( self , key ) :
if key in [ " Up " , " Down " , " Left " , " Right " ] :
self . stop_scrolling ( )
self . stop_scrolling ( )
def start_scrolling ( self , direction ) :
self . scrolling_direction = direction
if not self . scrolling :
self . scrolling = 1
def stop_scrolling ( self ) :
self . scrolling = 0
def scroll ( self ) :
if self . scrolling :
if not self . scrolling % 5 :
if self . scrolling_direction == " Up " :
self . scroll_cursor ( y = - 1 )
elif self . scrolling_direction == " Down " :
self . scroll_cursor ( y = 1 )
elif self . scrolling_direction == " Left " :
self . scroll_cursor ( x = - 1 )
elif self . scrolling_direction == " Right " :
self . scroll_cursor ( x = 1 )
self . scrolling + = 1