-fixed a bug where mouse on the console would sometimes cause a crash
This commit is contained in:
parent
7ac1093231
commit
9ca821bab8
3
Pole.py
3
Pole.py
@ -55,5 +55,8 @@ class Pole:
|
|||||||
def check_collision(self,mouse_x,mouse_y):
|
def check_collision(self,mouse_x,mouse_y):
|
||||||
mouse_x=math.floor(mouse_x/dCon.CUBE_SIZE)
|
mouse_x=math.floor(mouse_x/dCon.CUBE_SIZE)
|
||||||
mouse_y=math.floor(mouse_y/dCon.CUBE_SIZE)
|
mouse_y=math.floor(mouse_y/dCon.CUBE_SIZE)
|
||||||
|
if(mouse_x<20):
|
||||||
|
if(mouse_y<12):
|
||||||
collided=self.get_slot_from_cord((mouse_x,mouse_y))
|
collided=self.get_slot_from_cord((mouse_x,mouse_y))
|
||||||
return collided.print_status()
|
return collided.print_status()
|
||||||
|
return ""
|
@ -24,7 +24,6 @@ def getScreenHeihgt():
|
|||||||
def getScreenWidth(show_console):
|
def getScreenWidth(show_console):
|
||||||
screen_width=getGameWidth()
|
screen_width=getGameWidth()
|
||||||
if(show_console):
|
if(show_console):
|
||||||
print("true")
|
|
||||||
screen_width=screen_width+350
|
screen_width=screen_width+350
|
||||||
return screen_width
|
return screen_width
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user