Skip to content

Commit

Permalink
refactor: Refactor ground.py to improve rendering accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasfremming committed Nov 3, 2024
1 parent 209198d commit de045e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/agent_parts/limb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def render(self, screen):
# Convert pymunk Vec2d vertices to pygame coordinates
vertices = [(int(v.x), int(v.y)) for v in vertices]
# Draw the polygon onto the screen
pygame.draw.polygon(surface=screen, color=(0, 255, 0), vertices=vertices, width=0)
pygame.draw.polygon(surface=screen, color=(0, 255, 0), points=vertices, width=0)
5 changes: 0 additions & 5 deletions src/agent_parts/motorjoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def render(self, screen, body_a, body_b):
"""Render the motor joint as a small red circle between the two bodies."""
# Get the positions of the two bodies
pos_a_world = body_a.local_to_world(self.pivot.anchor_a)
<<<<<<< Updated upstream
# Draw a line connecting the two bodies
pygame.draw.circle(
screen,
Expand All @@ -31,7 +30,3 @@ def render(self, screen, body_a, body_b):
def get_angle(self):
"""Get the angle of the motor joint."""
return self.pivot.angle
=======
# Draw a circle connecting the two bodies
pygame.draw.circle(surface=screen, color=(255, 0, 0), center=(int(pos_a_world.x), int(pos_a_world.y)), radius=3)
>>>>>>> Stashed changes

0 comments on commit de045e0

Please sign in to comment.