Skip to content

Commit

Permalink
feat: Stops ground from moving when paused
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniavm committed Nov 5, 2024
1 parent 6e58b88 commit cc0d52a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion agent_parts_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def make_limb():
creature.update_creature_position(dragged_limb, new_position)

screen.fill((135, 206, 235))
environment.update()
if(physics_on):
environment.update()
environment.render()

#creature.set_joint_rates([random.random()*2, random.random()*2])
Expand Down
4 changes: 2 additions & 2 deletions src/agent_parts/creature.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pymunk
import pygame
from agent_parts.limb import Limb
from agent_parts.motorjoint import MotorJoint
from src.agent_parts.limb import Limb
from src.agent_parts.motorjoint import MotorJoint


class Creature:
Expand Down
5 changes: 3 additions & 2 deletions src/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def add_button(self, button: Button) -> Button:
return button

def remove_button(self, button: Button) -> Button:
self.elements.remove(button)
return button
if button in self.elements:
self.elements.remove(button)
return button

def render(self, screen):
"""Render all UI elements."""
Expand Down

0 comments on commit cc0d52a

Please sign in to comment.