MCPcopy Create free account
hub / github.com/ActiveState/code / draw

Function draw

recipes/Python/502216_Boids_Demonstration/recipe-502216.py:42–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 graph.after(40, update)
41
42def draw():
43 # Draw all boids.
44 graph.delete(ALL)
45 for boid in boids:
46 x1 = boid.position.x - BOID_RADIUS
47 y1 = boid.position.y - BOID_RADIUS
48 x2 = boid.position.x + BOID_RADIUS
49 y2 = boid.position.y + BOID_RADIUS
50
51 graph.create_oval((x1, y1, x2, y2), fill='red')
52 graph.update()
53
54def move():
55 # Move all boids.

Callers 1

updateFunction · 0.70

Calls 2

deleteMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected