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

Method render

recipes/Python/578007_processing_DEMO_Boids/recipe-578007.py:36–44  ·  view source on GitHub ↗

Displays the boids on the graphics every time called.

(self, graphics)

Source from the content-addressed store, hash-verified

34 self.pointer = 0
35
36 def render(self, graphics):
37 "Displays the boids on the graphics every time called."
38 self.add_fish()
39 graphics.clear()
40 fish = 0
41 for school in self.schools:
42 school.render(graphics)
43 fish += school.size()
44 graphics.write(5, 5, fish, 'white')
45
46 def add_fish(self):
47 "Add a fish to the next school while creating more fish."

Callers 1

renderMethod · 0.45

Calls 4

add_fishMethod · 0.95
clearMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected