Exemple #1
0
 public Pong(TennisPongForm parent)
 {
     this.Parent = parent;
     this.ServiceJoueur1 = true;
     this.ServiceJoueur2 = false;
     this.AllerBalle = true;
     this.Partie = false;
     this.AngleBalle = 0;
     this.AngleJoueur1 = 0;
     this.AngleJoueur2 = 0;
     this.TimerBalle = new System.Timers.Timer();
     this.TimerBalle.Elapsed += new ElapsedEventHandler(this.OnTimedEvent);
     this.TimerBalle.Interval = 1;
     this.TimerBalle.Enabled = false;
     this.ScoreJoueur1 = new Score();
     this.ScoreJoueur2 = new Score();
     this.Jeu = new Jeu();
     this.Set = new Set();
     this.Match = new Match();
     this.SoundPlayer = new SoundPlayer();
     this.VibrationsJoueur1 = false;
     this.VibrationsJoueur2 = false;
     this.Sons = false;
     this.OnPointEnded += new PointEndedEventHandler(this.Pong_OnPointEnded);
     this.OnGameEnded += new GameEndedEventHandler(this.Pong_OnGameEnded);
     this.OnSetEnded += new SetEndedEventHandler(this.Pong_OnSetEnded);
     this.onMatchEnded += new MatchEndedEventHandler(Pong_onMatchEnded);
     this.UpButtonPressedJoueur1 = 0;
     this.UpButtonPressedJoueur2 = 0;
     this.DownButtonPressedJoueur1 = 0;
     this.DownButtonPressedJoueur2 = 0;
     this.CreateEnvironment();
 }
Exemple #2
0
 public Ai(TennisPongForm parent)
 {
     this.Parent = parent;
     this.AiSkill = 150; // ms
     this.Ai1Controller = new Thread(this.Ai1Thread);
     this.Ai1Controller.Priority = ThreadPriority.BelowNormal;
     this.Ai2Controller = new Thread(this.Ai2Thread);
     this.Ai2Controller.Priority = ThreadPriority.BelowNormal;
 }
 public Manette(TennisPongForm parent)
 {
     this.Parent = parent;
     this.Manette1 = new GamepadState(UserIndex.One);
     this.Manette2 = new GamepadState(UserIndex.Two);
     this.ManetteController = new Thread(this.ManetteThread);
     this.ManetteController.Priority = ThreadPriority.Lowest;
     this.Manette1Controller = new Thread(this.Manette1Thread);
     this.Manette1Controller.Priority = ThreadPriority.BelowNormal;
     this.Manette2Controller = new Thread(this.Manette2Thread);
     this.Manette2Controller.Priority = ThreadPriority.BelowNormal;
     this.ManetteController.Start();
 }