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

Method render

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

Draw the fish's shape on the given graphics context.

(self, graphics)

Source from the content-addressed store, hash-verified

125 self.trim_color = trim_color
126
127 def render(self, graphics):
128 "Draw the fish's shape on the given graphics context."
129 polygon = self.SHAPE.copy()
130 polygon.rotate(self.velocity.direction)
131 polygon.translate(self.location)
132 graphics.draw(polygon, self.body_color, self.trim_color)
133
134 def run_AI(self, school):
135 "Execute the three boid rules and store in steering."

Callers

nothing calls this directly

Calls 4

copyMethod · 0.45
rotateMethod · 0.45
translateMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected