MCPcopy Index your code
hub / github.com/geekcomputers/Python / update

Method update

brickout-game/brickout-game.py:258–269  ·  view source on GitHub ↗

checks collision between ball and bricks.

(self, ball)

Source from the content-addressed store, hash-verified

256 brick.draw()
257
258 def update(self, ball):
259 """
260 checks collision between ball and bricks.
261 """
262 for i in range(len(self._bricks)):
263 if (self._bricks[i] != None) and self._bricks[i].collide(ball):
264 self._bricks[i] = None
265
266 # removes the None-elements from the brick list.
267 for brick in self._bricks:
268 if brick is None:
269 self._bricks.remove(brick)
270
271 def hasWin(self):
272 """

Callers

nothing calls this directly

Calls 2

collideMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected