diff --git a/proposal.md/__pycache__/shooter.cpython-313.pyc b/proposal.md/__pycache__/shooter.cpython-313.pyc index f40f04a..aee1273 100644 Binary files a/proposal.md/__pycache__/shooter.cpython-313.pyc and b/proposal.md/__pycache__/shooter.cpython-313.pyc differ diff --git a/proposal.md/__pycache__/targets.cpython-313.pyc b/proposal.md/__pycache__/targets.cpython-313.pyc index cee5b3a..43cd37b 100644 Binary files a/proposal.md/__pycache__/targets.cpython-313.pyc and b/proposal.md/__pycache__/targets.cpython-313.pyc differ diff --git a/proposal.md/nav_game.py b/proposal.md/nav_game.py index 003698d..559368c 100644 --- a/proposal.md/nav_game.py +++ b/proposal.md/nav_game.py @@ -1,14 +1,16 @@ from retro.game import Game from spaceship import Spaceship -# from asteroid_spawner import AsteroidSpawner +from asteroid_spawner import AsteroidSpawner from targets import Alien from shooter import Shooter import random + board_size = (100, 25) width, height = board_size ship = Spaceship(board_size) -shooter = Shooter() -spawner = Alien((random.randint(0, width-1), random.randint(0, height-1))) -game = Game([ship, spawner, shooter], {"score": 0}, board_size=board_size, color="white_on_blue") -game.play() \ No newline at end of file +shooter = Shooter() +asteroid_spawner = AsteroidSpawner() +alien = Alien((random.randint(0, width - 1), random.randint(0, height - 1))) +game = Game([ship, shooter, asteroid_spawner, alien],{"score": 0},board_size=board_size,color="black_on_red") +game.play() diff --git a/proposal.md/shooter.py b/proposal.md/shooter.py index e633efb..376e947 100644 --- a/proposal.md/shooter.py +++ b/proposal.md/shooter.py @@ -9,7 +9,6 @@ class Shooter: self.position = (0, 0) def handle_keystroke(self, keystroke, game): - if keystroke == ' ' and not self.display: ship = game.get_agent_by_name('ship') if ship is None: @@ -23,9 +22,7 @@ class Shooter: self.display = True def play_turn(self, game): - if not self.display: - return x, y = self.position diff --git a/proposal.md/targets.py b/proposal.md/targets.py index 391ad96..757f07f 100644 --- a/proposal.md/targets.py +++ b/proposal.md/targets.py @@ -8,20 +8,18 @@ class Alien: self.position = position def play_turn(self, game): - width, height = game.board_size - x, y = self.position directions = [ - (-1, 0), # left - (1, 0), # right - (0, -1), # up - (0, 1), # down - (-1, -1), # up-left - (-1, 1), # down-left - (1, -1), # up-right - (1, 1) # down-right + (-2, 0), # left + (2, 0), # right + (0, -2), # up + (0, 2), # down + (-2, -2), # up-left + (-2, 2), # down-left + (2, -2), # up-right + (2, 2) # down-right ] possible_positions = []