diff --git a/__pycache__/frog.cpython-313.pyc b/__pycache__/frog.cpython-313.pyc index 5d011b8..ab4b64c 100644 Binary files a/__pycache__/frog.cpython-313.pyc and b/__pycache__/frog.cpython-313.pyc differ diff --git a/__pycache__/obstacle.cpython-313.pyc b/__pycache__/obstacle.cpython-313.pyc index 33909a0..9aec1db 100644 Binary files a/__pycache__/obstacle.cpython-313.pyc and b/__pycache__/obstacle.cpython-313.pyc differ diff --git a/__pycache__/obstacle_spawner.cpython-313.pyc b/__pycache__/obstacle_spawner.cpython-313.pyc index cc6fba4..3f7475b 100644 Binary files a/__pycache__/obstacle_spawner.cpython-313.pyc and b/__pycache__/obstacle_spawner.cpython-313.pyc differ diff --git a/obstacle.py b/obstacle.py index 0c7a6e2..ac29cf0 100644 --- a/obstacle.py +++ b/obstacle.py @@ -12,7 +12,7 @@ class Obstacle: game.remove_agent(self) else: froggy = game.get_agent_by_name('froggy') - new_position = (x, y + 1) + new_position = (x, y) if new_position == froggy.position: game.end() else: diff --git a/obstacle_spawner.py b/obstacle_spawner.py index 6beb2c4..6033dc3 100644 --- a/obstacle_spawner.py +++ b/obstacle_spawner.py @@ -8,7 +8,7 @@ class ObstacleSpawner: width, height = game.board_size game.state['score'] += 1 if self.should_spawn_obstacle(game.turn_number): - obstacle = Obstacle((randint(0, width - 1), 0)) + obstacle = Obstacle((randint(0, width - 1), randint(0, width-1))) game.add_agent(obstacle) def should_spawn_obstacle(self, turn_number):