From 9ca821bab87006e541cc6754e1645933c02a8c5d Mon Sep 17 00:00:00 2001 From: jakzar Date: Sat, 13 Apr 2024 02:09:49 +0200 Subject: [PATCH] -fixed a bug where mouse on the console would sometimes cause a crash --- Pole.py | 7 +++++-- displayControler.py | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Pole.py b/Pole.py index 017848e..f2c6f4d 100644 --- a/Pole.py +++ b/Pole.py @@ -55,5 +55,8 @@ class Pole: def check_collision(self,mouse_x,mouse_y): mouse_x=math.floor(mouse_x/dCon.CUBE_SIZE) mouse_y=math.floor(mouse_y/dCon.CUBE_SIZE) - collided=self.get_slot_from_cord((mouse_x,mouse_y)) - return collided.print_status() \ No newline at end of file + if(mouse_x<20): + if(mouse_y<12): + collided=self.get_slot_from_cord((mouse_x,mouse_y)) + return collided.print_status() + return "" \ No newline at end of file diff --git a/displayControler.py b/displayControler.py index 492395a..f09da3f 100644 --- a/displayControler.py +++ b/displayControler.py @@ -24,7 +24,6 @@ def getScreenHeihgt(): def getScreenWidth(show_console): screen_width=getGameWidth() if(show_console): - print("true") screen_width=screen_width+350 return screen_width