Permalink
Browse files

Modifications mineure

  • Loading branch information...
1 parent 39cd36b commit de5ea55157f8436d1dc63a6b91e92a4a295802fa @cgorrieri committed May 28, 2012
Showing with 23 additions and 27 deletions.
  1. +0 −1 KiPong/KiPong/Aide.cs
  2. +11 −9 KiPong/KiPong/Game1.cs
  3. +7 −5 KiPong/KiPong/Menu.cs
  4. +5 −12 KiPong/KiPong/Utils.cs
@@ -18,7 +18,6 @@ public Aide(Game1 g, String nameImage, String nameText)
game = g;
image = g.Content.Load<Texture2D>(nameImage);
text = g.Content.Load<String>(nameText);
- Console.WriteLine(text);
}
public void Speech()
@@ -148,7 +148,7 @@ private void SetMenus()
PauseMenu = new MenuKeyboard(this, keyboardInput);
EndMenu = new MenuKeyboard(this, keyboardInput);
}
- SetMenu(PlayingMenu, "KiPong", "Choisis le nombre de joueurs", new List<string>() { "1 joueur", "2 joueurs" });
+ SetMenu(PlayingMenu, "Jouer", "Choisis le nombre de joueurs", new List<string>() { "1 joueur", "2 joueurs" });
SetMenu(DifficultyMenu, "Difficultes", "Choisis la difficultées", new List<string>() { "Facile", "Moyen", "Difficile" });
SetMenu(PauseMenu, "Pause", "Que veux-tu faire", new List<string>() { "Reprendre", "Menu", "Quitter" });
EndMenu.MenuItems = new List<string>() { "Menu", "Quitter" };
@@ -183,7 +183,9 @@ protected override void Update(GameTime gameTime)
jeu.Update();
if (jeu.Finish)
{
- EndMenu.Title = jeu.getMessage();
+ EndMenu.Title = "Fin du jeu";
+ EndMenu.Description = jeu.getMessage();
+ EndMenu.StartDescription();
keyboardInput.IsHoldable = false;
gamestate = GameStates.EndMenu;
}
@@ -218,7 +220,7 @@ protected override void Update(GameTime gameTime)
this.Exit();
}
SetMenus();
- PlayingMenu.Start = true;
+ PlayingMenu.StartDescription();
ModeMenu.Iterator = 0;
}
}
@@ -232,7 +234,7 @@ protected override void Update(GameTime gameTime)
if (PlayingMenu.Valid)
{
gamestate = GameStates.DifficultyMenu;
- DifficultyMenu.Start = true;
+ DifficultyMenu.StartDescription();
if (PlayingMenu.Iterator == 0)
{
IsOnePlayer = true;
@@ -246,7 +248,7 @@ protected override void Update(GameTime gameTime)
if (PlayingMenu.Back)
{
gamestate = GameStates.ModeMenu;
- ModeMenu.Start = true;
+ ModeMenu.StartDescription();
IsKinectMode = false;
}
}
@@ -279,7 +281,7 @@ protected override void Update(GameTime gameTime)
if (DifficultyMenu.Back)
{
gamestate = GameStates.PlayingMenu;
- PlayingMenu.Start = true;
+ PlayingMenu.StartDescription();
}
}
#endregion DifficultyMenu
@@ -301,7 +303,7 @@ protected override void Update(GameTime gameTime)
else if (PauseMenu.Iterator == 1)
{
gamestate = GameStates.PlayingMenu;
- PlayingMenu.Start = true;
+ PlayingMenu.StartDescription();
}
else if (PauseMenu.Iterator == 2)
{
@@ -329,7 +331,7 @@ protected override void Update(GameTime gameTime)
if (EndMenu.Iterator == 0)
{
gamestate = GameStates.PlayingMenu;
- PlayingMenu.Start = true;
+ PlayingMenu.StartDescription();
}
else if (EndMenu.Iterator == 1)
{
@@ -346,7 +348,7 @@ protected override void Update(GameTime gameTime)
if (splashScreenTimer.CompareTo(new TimeSpan(0)) <= 0)
{
gamestate = GameStates.ModeMenu;
- ModeMenu.Start = true;
+ ModeMenu.StartDescription();
}
}
#endregion SplashCreen
View
@@ -47,7 +47,7 @@ public int Iterator
protected bool isPrintingHelp;
// Draw
private bool isDraw;
- public bool Start { get; set; }
+ private bool start;
private Rectangle rectTitle, rectItem;
private int margin;
@@ -73,14 +73,16 @@ private void SetItems()
rectItem = new Rectangle(margin, 0, width, height);
}
+ public void StartDescription() { start = true; }
+
public virtual void Update()
{
- if (Start && isDraw)
+ if (start && isDraw)
{
Utils.SpeechStop();
Utils.SpeechSynchrone(Description);
lastIterator = -1;
- Start = false;
+ start = false;
Iterator=0;
}
@@ -93,7 +95,7 @@ public virtual void Update()
{
isPrintingHelp = false;
Utils.SpeechStop();
- Start = true;
+ start = true;
}
}
@@ -106,7 +108,7 @@ public void Draw()
return;
}
- isDraw = Start;
+ isDraw = start;
Utils.DrawRectangle(game.SpriteBatch, rectTitle, Gray);
Utils.DrawStringAtCenter(game.SpriteBatch, game.FontTitle, rectTitle, Title, Blue);
@@ -1,20 +1,13 @@
-#define _MICROSOFT_SPEECH
-#if MICROSOFT_SPEECH
-using Microsoft.Speech;
-using Microsoft.Speech.Synthesis;
-#else
-using System.Speech;
-using System.Speech.Synthesis;
-#endif
-
-using System;
+using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
+using System.Media;
+using System.Speech;
+using System.Speech.Synthesis;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
-using System.IO;
-using System.Media;
// test
namespace KiPong

0 comments on commit de5ea55

Please sign in to comment.