MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / _square

Function _square

1-grid-world/env.py:41–46  ·  view source on GitHub ↗
(surf, x, y, unit, color, y_off=0, fill=True)

Source from the content-addressed store, hash-verified

39
40
41def _square(surf, x, y, unit, color, y_off=0, fill=True):
42 cx, cy = _center(x, y, unit, y_off)
43 s = int(unit * 0.65)
44 rect = pygame.Rect(cx - s // 2, cy - s // 2, s, s)
45 pygame.draw.rect(surf, color, rect, 0 if fill else 3)
46 return rect
47
48
49def _circle(surf, x, y, unit, color, y_off=0):

Callers 2

renderMethod · 0.85
renderMethod · 0.85

Calls 1

_centerFunction · 0.85

Tested by

no test coverage detected