generated from mwc/project_game
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:
parent
60a4069e87
commit
ba4a255ca1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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):
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
'''
|
|
@ -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'''
|
|
@ -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()
|
|
@ -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
|
||||
'''
|
Loading…
Reference in New Issue