Пример #1
0
 public Ball(Game game)
 {
     this.game = game;
     StartPosition = new Point(Parameters.Area.Width / 2, Parameters.Area.Height / 2);
     Position = StartPosition;
     VSpeed = 0.0;
     HSpeed = 0.0;
 }
Пример #2
0
        public Area(Game game)
        {
            this.game = game;

            Size = new Size(Parameters.Area.Width, Parameters.Area.Height);
            Border = new Rect(
                Parameters.Border.DistanceFromArea,
                Parameters.Border.DistanceFromArea,
                Parameters.Area.Width - Parameters.Border.DistanceFromArea * 2,
                Parameters.Area.Height - Parameters.Border.DistanceFromArea * 2);
        }
Пример #3
0
        public PongImage()
        {
            this.SizeChanged += new SizeChangedEventHandler(PongImage_SizeChanged);
            drawingGroup = new DrawingGroup();
            Source = new DrawingImage(drawingGroup);
            Game = new Game(this);
            Game.Kinect.OnFrame += new EventHandler(Kinect_OnFrame);

            fpsTimeStamp = DateTime.Now;
            fpsCounter = 0;

            Draw();
        }
Пример #4
0
        public Player(Game game, PlayerIndex index)
        {
            this.game = game;
            this.playerIndex = index;

            //Set Position of Score text
            if (index == PlayerIndex.Player1)
                scorePosition = new Point((game.Area.Border.Width / 4) + game.Area.Border.X, game.Area.Border.Y + 20);
            else
                scorePosition = new Point((game.Area.Border.Width / 4 * 3) + game.Area.Border.X, game.Area.Border.Y + 20);

            Paddle = new Paddle(game, this);
        }
Пример #5
0
 public Kinect(Game game)
 {
     this.game = game;
 }
Пример #6
0
 public Paddle(Game game, Player player)
 {
     this.game = game;
     this.player = player;
     YPosition = game.Area.InnerBorder.Height / 2;
 }