// To update IsFinal, HasActions and Actions private void Update() { IsFinal = (this.player == levelInstance.goal); HasActions = !levelInstance.walls.Contains(this.player); foreach (var action in GridWorld <QLearning> .ACTIONS) { Vector2 move = GridWorld <QLearning> .PlayAction(action); Vector2 playerMove = this.player + move; // C'est un coup valid si le joueur n'est pas allé sur un mur if (!levelInstance.walls.Contains(playerMove)) { Actions.Add(action); } } }
//SpriteBatch spriteBatch; public GridWorldGame() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; gridWorld = new GridWorld(Content); }