public override void Reset() { // Please add the resetting of your game here, such as new random generation base.Reset(); // This calls MiniGame.Reset() to reset other things random = new Random(); int mot_index = random.Next(0, allWords.Length); mot = allWords[mot_index]; //mot à classer MediaPlayer.Play(song1, new TimeSpan(0, 1, 0)); if (inWords.Contains(mot)) { dest = Destination.Gauche; //appartient à la banane } else { dest = Destination.Droite; } input = Destination.None; gordonState = GordonState.Attente; tailleTexte = 1f; offsetTexte = new Vector2(0, 0); }
public override void Update(GameTime gameTime) { if (game_status == GameStatus.Pending) { if (Keyboard.GetState().IsKeyDown(Keys.Left)) { input = Destination.Gauche; //( à remplacer par souris ptetre) } if (Keyboard.GetState().IsKeyDown(Keys.Right)) { input = Destination.Droite; } if (input != Destination.None) { if (input == dest) { base.Win(); } else { base.Lose(); } } } else if (game_status == GameStatus.Win) { if (dest == Destination.Gauche) { offsetTexte.X -= 5; offsetTexte.Y += 5; //translation vers banane } else { offsetTexte.X += 5; offsetTexte.Y += 5; gordonState = GordonState.Heureux; //translation vers gordon } } else if (game_status == GameStatus.Lose) { if (dest == Destination.Gauche) //si destination banane + erreur { gordonState = GordonState.Colere; } } base.Update(gameTime); }