示例#1
0
 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);
 }
示例#2
0
 public KinectInput(Game1 g)
     : base(g)
 {
     LeftY = RightY = 0;
     KinectSensor.KinectSensors.StatusChanged += new EventHandler<StatusChangedEventArgs>(KinectSensors_StatusChanged);
     DiscoverKinectSensor();
 }
示例#3
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
示例#4
0
 public Menu(Game1 g, String title, List<string> items)
 {
     game = g;
     Title = title;
     MenuItems = items;
     Iterator = 0;
 }
示例#5
0
 public Jeu(Game1 g, Difficulty d, bool isOnePlayer)
 {
     game = g;
     IsOnePlayer = isOnePlayer;
     difficulty = d;
     ball = new Ball(game, d);
     resetTimer = 0;
     resetTimerInUse = true;
     decompte = "";
     lastScored = Side.LEFT;
 }
示例#6
0
 public Ball(Game1 game, Difficulty d)
 {
     // creer la balle
     setSpeed(d);
     int width = game.ScreenWidth / 30;
     texture = game.Content.Load<Texture2D>("balle");
     scale = (float) width / (float) texture.Width;
     size = new Rectangle(0, 0, width, width);
     resetPos = new Vector2(game.ScreenWidth / 2, game.ScreenHeight / 2);
     position = resetPos;
     direction = 0;
     rand = new Random();
     isVisible = false;
 }
示例#7
0
 /// <summary>
 /// Initialise une batte
 /// </summary>
 /// <param name="game">Le jeu propriétaire</param>
 /// <param name="side">Si true alors à gauche sinon à droite de l'écran</param>
 public Bat(Game1 game, Side side, Difficulty d)
 {
     points = 0;
     this.side = side;
     int height = game.ScreenHeight / getRatio(d);
     int width = game.ScreenWidth / RatioWidth;
     texture = new Texture2D(game.GraphicsDevice, width, height);
     Color[] dataTitle = new Color[width * height];
     for (int index = 0; index < dataTitle.Length; ++index) dataTitle[index] = Color.Yellow;
     texture.SetData(dataTitle);
     size = new Rectangle(0, 0, width, height);
     if (side == Side.LEFT) position = new Vector2(0, game.ScreenHeight / 2 - height / 2);
     else position = new Vector2(game.ScreenWidth - width, game.ScreenHeight / 2 - height / 2);
     yHeight = game.ScreenHeight;
 }
示例#8
0
 /// <summary>
 /// Initialise une batte
 /// </summary>
 /// <param name="game">Le jeu propriétaire</param>
 /// <param name="side">Si true alors à gauche sinon à droite de l'écran</param>
 public BatKeyboard(Game1 game, Side side, Difficulty d, KeyboardInput i)
     : base(game, side, d)
 {
     input = i;
     switch (d)
     {
         case Difficulty.EASY:
             BaseSpeed = 8f;
             increaseSpeed = 0.9f;
             break;
         case Difficulty.MEDIUM:
             BaseSpeed = 10f;
             increaseSpeed = 1.8f;
             break;
         default:
             BaseSpeed = 12f;
             increaseSpeed = 3.6f;
             break;
     }
     MaxSpeed = BaseSpeed + 3 * increaseSpeed;
     speed = BaseSpeed;
 }
示例#9
0
 /// <summary>
 /// Initialise une batte
 /// </summary>
 /// <param name="game">Le jeu propriétaire</param>
 /// <param name="side">Si true alors à gauche sinon à droite de l'écran</param>
 public BatKinect(Game1 game, Side side, Difficulty d, KinectInput i)
     : base(game, side, d)
 {
     input = i;
 }
示例#10
0
 public JeuKinect(Game1 g, Difficulty d, bool isOp, KinectInput i)
     : base(g, d, isOp)
 {
     input = i;
     setBats();
 }
示例#11
0
 public KeyboardInput(Game1 g)
     : base(g)
 {
     keyboardState = Keyboard.GetState();
     lastState = keyboardState;
 }
示例#12
0
 public Input(Game1 g)
 {
     game = g;
 }
示例#13
0
 public AIBat(Game1 game, Side side, Difficulty d, Ball b)
     : base(game, side, d, null)
 {
     ball = b;
 }
示例#14
0
 public JeuKeyboard(Game1 g, Difficulty d, bool isOp, KeyboardInput i)
     : base(g, d, isOp)
 {
     input = i;
     setBats();
 }
示例#15
0
 public MenuKinect(Game1 g, String title, List<string> items, KinectInput input)
     : base(g, title, items)
 {
     this.input = input;
 }
示例#16
0
 public MenuKeyboard(Game1 g, String title, List<string> items, KeyboardInput input)
     : base(g, title, items)
 {
     this.input = input;
 }