From ec9166243ec2e06fab2eb202c5b3c5c4b9c62a35 Mon Sep 17 00:00:00 2001 From: DannyAbdi <dannyabdi13@gmail.com> Date: Thu, 21 Mar 2024 03:08:46 +0000 Subject: [PATCH] reformated code --- enemy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/enemy.py b/enemy.py index 6c32d2a..86df1c2 100644 --- a/enemy.py +++ b/enemy.py @@ -4,6 +4,8 @@ from config import * """ Class representing an enemy agent in the game. """ + + class Enemy: """ Initialise the Enemy object. @@ -12,6 +14,7 @@ class Enemy: :param x (int): The x-coordinate of the enemy's position. :param y (int): The y-coordinate of the enemy's position. """ + def __init__(self, maze): self.maze = maze self.x, self.y = self.reset_position() @@ -21,6 +24,7 @@ class Enemy: :return: tuple: A tuple containing the x and y coordinates of the enemy's position. """ + def reset_position(self): while True: num_rows = self.maze.num_rows() @@ -41,5 +45,6 @@ class Enemy: :param screen: The Pygame screen surface to draw on. """ + def draw(self, screen): pygame.draw.rect(screen, 'blue', (self.x, self.y, TILE_SIZE, TILE_SIZE)) -- GitLab