from random import choice
-from naja.constants import BITS, DIRECTION_BITS, CONDITION_BITS
+from naja.constants import(
+ BITS, DIRECTION_BITS, CONDITION_BITS, PLAYER_DEFAULTS)
from naja.player import Player
from naja import actions
self.board_locations = board_locations
@classmethod
- def new_game(cls, max_health, wins_required, locations_definition):
+ def new_game(cls, locations_definition,
+ initial_bits=PLAYER_DEFAULTS.INITIAL_BITS,
+ initial_pos=PLAYER_DEFAULTS.INITIAL_POS,
+ max_health=PLAYER_DEFAULTS.MAX_HEALTH,
+ wins_required=PLAYER_DEFAULTS.WINS_REQUIRED):
state = {
'max_health': max_health,
'health': max_health,
'wins': 0,
'locations': locations_definition,
}
- player = Player(0x0f, (2, 2))
+ player = Player(initial_bits, initial_pos)
board_locations = cls.generate_board(locations_definition)
return cls(state, player, board_locations)