MCPcopy
hub / github.com/geekcomputers/Python / iscollision

Function iscollision

python Space Invader game.py:93–100  ·  view source on GitHub ↗
(enemyx, enemyy, bulletx, bullety)

Source from the content-addressed store, hash-verified

91
92
93def iscollision(enemyx, enemyy, bulletx, bullety):
94 distance = math.sqrt(
95 (math.pow(enemyx - bulletx, 2)) + (math.pow(enemyy - bullety, 2))
96 )
97 if distance < 27:
98 return True
99 else:
100 return False
101
102
103# game loop

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected