Final version of project

Did not have a chance to add a chaser character, still might try that,
but wanted to make sure I submit my working version first.
This commit is contained in:
Chris Mekelburg 2024-12-13 19:45:14 -05:00
parent 60a4069e87
commit ba4a255ca1
12 changed files with 5 additions and 62 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
gamefiles/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -50,7 +50,7 @@ class Board:
def play_turn(self,game):
'''Checks after every turn (turn is length of time specified in retro) if the game needs snacks
or mines.'''
game.log(game.state['Score'])
#game.log(game.state['Score'])
while self.game_needs_snacks(game):
self.add_snack(game)
while self.game_needs_mines(game):

View File

@ -1,4 +1,5 @@
#List of helper functions to move the man
'''List of helper functions to move the man, none used in this game, but here in
case needed for future version'''
'''def add(vec0, vec1):
"""Adds two vectors.

View File

@ -1,28 +0,0 @@
MAX_MINES = 50
LEVELS = [
[5, 10],
[50, 20],
[75, 30],
[100, 40]
]
def num_mines(score):
for limit, n in LEVELS:
if score < limit:
return n
return MAX_MINES
'''
if score < 5:
num_mines = 10
if 10 <= score <50:
num_mines = 20
if 50 <= score <75:
num_mines = 30
if 75 <= score <100:
num_mines = 40
#else:
#num_mines = 50
return num_mines
'''

View File

@ -1,2 +0,0 @@
'''Not currently in use, may use if minecounter needs to be more complex
but for now it is included in board.py'''

View File

@ -5,7 +5,7 @@ from board import Board
width = 25
height = 25
state= {"Score":00}
state= {"Score": 0}
num_snacks = 10
board = Board(width,height,num_snacks,state) #sets the original board
@ -13,6 +13,6 @@ board = Board(width,height,num_snacks,state) #sets the original board
game = Game(
board.get_agents(num_snacks,state),
state,
board_size = (width, height),debug=True
board_size = (width, height),debug=False
)
game.play()

View File

@ -1,28 +0,0 @@
MAX_MINES = 50
LEVELS = [
[5, 10],
[50, 20],
[75, 30],
[100, 40]
]
def num_mines(score):
for limit, n in LEVELS:
if score < limit:
return n
return MAX_MINES
'''
if score < 5:
num_mines = 10
if 10 <= score <50:
num_mines = 20
if 50 <= score <75:
num_mines = 30
if 75 <= score <100:
num_mines = 40
#else:
#num_mines = 50
return num_mines
'''