MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / hit_bat

Method hit_bat

DemoPrograms/Demo_Pong_Multiple_Platforms.py:66–71  ·  view source on GitHub ↗
(self, pos)

Source from the content-addressed store, hash-verified

64 str(val), (550, 50), font=('courier 40'), color='white')
65
66 def hit_bat(self, pos):
67 bat_pos = (self.bat_1.curx, self.bat_1.cury)
68 if pos[0] >= bat_pos[0] and pos[0] <= bat_pos[0]+BAT_SIZE[0]:
69 if bat_pos[1] <= pos[1] <= bat_pos[1]+BAT_SIZE[1]:
70 return True
71 return False
72
73 def hit_bat2(self, pos):
74 bat_pos = (self.bat_2.curx, self.bat_2.cury)

Callers 1

drawMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected