コード例 #1
0
ファイル: environment.py プロジェクト: Frequel/SnakeRL
 def __init__(self,
              game_width,
              game_height,
              reward_function=default_reward):
     self.game_width = game_width
     self.game_height = game_height
     self.game = Game(game_width, game_height)
     self.player = self.game.player
     self.food = self.game.food
     self.get_reward = reward_function
コード例 #2
0
ファイル: SnakeEnv.py プロジェクト: Frequel/SnakeRL
    def reset(self):
        self.game = Game(self.game_width, self.game_height)
        self.player = self.game.player
        self.food = self.game.food

        self.screen.game = self.game
        self.screen.player = self.player
        self.screen.food = self.food
        self.count = 0
        return self.__get_state()
コード例 #3
0
def game_start():
    """
    Pulls in hero data to the pool team of the current Game() class,
    and returns the Game() class that will be the basis of the draft
    """
    herolist = Hero_List(hots_db)
    heroclasses = []
    for item in herolist:
        heroclasses.append(Item(item, 'hero'))
    curgame = Game(Team('home'), Team('enemy'), Team('hero_pool', heroclasses), '')
    return curgame
コード例 #4
0
ファイル: SnakeEnv.py プロジェクト: Frequel/SnakeRL
    def __init__(self, game_width, game_height, reward_function=default_reward, enable_render=True):
        self.game_width = game_width
        self.game_height = game_height
        self.game = Game(game_width, game_height)
        self.player = self.game.player
        self.food = self.game.food
        self.get_reward = reward_function
        self.enable_render = enable_render
        self.screen = Screen(self.game, self.player, self.food)

        num_state = 2 ** 11
        self.action_space = spaces.Discrete(3)
        self.observation_space = spaces.Discrete(num_state)
        self.count = 0
        self.results = {'reward': [], 'score': []}

        self.cumulative_rewards = []
        self.cumulative_scores = []
        self.record = 0
コード例 #5
0
ファイル: environment.py プロジェクト: Frequel/SnakeRL
 def reset(self):
     self.game = Game(self.game_width, self.game_height)
     self.player = self.game.player
     self.food = self.game.food
     return self.__get_state(), self.game.crash
コード例 #6
0
from mods import Mod


class GameGUI:
    def __init__(self):
        pass


class startscreenGUI:
    def __init__(self):
        pass


class numberofplayersGUI:
    def __init__(self):
        pass


class playerselectGUI:
    def __init__(self):
        pass


class mapselectorGUI:
    def __init__(self):
        pass


game = Game()
game.main()