public float Mass; //Mass to calculate Forces public GameElement(ref GameApplication App, ref NewGame Game) : base(App) { this.App = App; this.Game = Game; this.Position = new Vector2(0, 0); }
public GameApplication() { #region XNA. this.IsMouseVisible = true; this.IsFixedTimeStep = true; this.Graphics = new GraphicsDeviceManager(this); this.Graphics.PreferMultiSampling = true; this.Graphics.PreferredBackBufferHeight = 768; this.Graphics.PreferredBackBufferWidth = 1366; this.Graphics.IsFullScreen = true; this.Graphics.ApplyChanges(); this.Content.RootDirectory = "Content"; #endregion #region Application. this.AppState = AppState.MainMenu; this.Application = this; this.GameEnd = new GameOver(); this.InstructionsWindow = new InstructionsWindow(); this.MainMenu = new MainMenu(); this.Game = new NewGame(ref this.Application); this.PauseMenu = new PauseMenu(); this.StopWatch = new Stopwatch(); this.UI = new UI(ref this.Application); #endregion this.Mute = false; }
public Puck(ref GameApplication App, ref NewGame Game) : base(ref App, ref Game) { this.Velocity = Vector2.Zero; this.PreviousPosition = Vector2.Zero; this.FrictionCoefficient = 0.5f; this.Acceleration = new Vector2(this.FrictionCoefficient * 9.8f, this.FrictionCoefficient * 9.8f); this.MaximumSpeed = 125; this.Mass = 0.05f; this.CornerCollision = false; }
public NewGame(ref GameApplication Application) { this.Application = Application; this.Game = this; this.CPU = new CPU(ref this.Application, ref this.Game); this.GameState = GameState.Running; this.Player = new Player(ref this.Application, ref this.Game); this.Puck = new Puck(ref this.Application, ref this.Game); this.Scoreboard = new Scoreboard(ref this.Application); this.StopWatch = new Stopwatch(); this.Table = new Table(ref this.Application, ref this.Game); }
// Member methods. /// <summary> /// Drawing the main menu buttons. /// </summary> /// <param name="Game"> The game where the main menu would be drawn. </param> /// public void Draw(ref NewGame Game) { MouseState State = Mouse.GetState(); // Getting mouse position. Vector2 Position = new Vector2(); Vector2 Origin = new Vector2(); Color Color = Color.Red * 1.5f; // Setting background. Game.spriteBatch.Draw(Game.Content.Load <Texture2D>("MenuBackGround"), Game.graphics.GraphicsDevice.Viewport.Bounds, Color.White); // The position where the start button would be drawn. Position.X = Game.graphics.GraphicsDevice.Viewport.Width / 2; Position.Y = Game.graphics.GraphicsDevice.Viewport.Height / 2 - 100; // The origin of the start button. Origin = Game.Font.MeasureString("Start") / 2; // Incase the mouse position is inside the start button. if (State.X >= StartButtonBeginX && State.X <= StartButtonEndX && State.Y >= StartButtonBeginY && State.Y <= StartButtonEndY) { Color = Color.White; // Adding vitality by changing the used color. } // Drawing the start button. Game.spriteBatch.DrawString(Game.Font, "Start", Position, Color, 0, Origin, 0.5f, SpriteEffects.None, 0.5f); Color = Color.Red * 1.5f; // The position where the exit button would be drawn. Position.Y += 200; // The origin of the exit button. Origin = Game.Font.MeasureString("Exit") / 2; // Incase the mouse position is inside the exit button. if (State.X >= ExitButtonBeginX && State.X <= ExitButtonEndX && State.Y >= ExitButtonBeginY && State.Y <= ExitButtonEndY) { Color = Color.White; // Adding vitality by changing the used color. } // Drawing the exit button. Game.spriteBatch.DrawString(Game.Font, "Exit", Position, Color, 0, Origin, 0.5f, SpriteEffects.None, 0.5f); }
public Player_Paddle(NewGame game) : base(game) { Velocity = new Vector2(0, 0); }
public Table(ref GameApplication App, ref NewGame Game) : base(App) { this.Game = Game; this.App = App; }
public Player(ref GameApplication App, ref NewGame Game) : base(ref App, ref Game) { this.PlayerPaddle = new PlayerPaddle(ref App, ref Game); }
public Paddle(ref GameApplication App, ref NewGame Game) : base(ref App, ref Game) { this.Mass = 0.135f; this.Position = new Vector2(0, 0); }
public PlayerPaddle(ref GameApplication App, ref NewGame Game) : base(ref App, ref Game) { this.Velocity = new Vector2(0, 0); }
public CPU(ref GameApplication App, ref NewGame Game) : base(ref App, ref Game) { this.CPUPaddle = new CPUPaddle(ref App, ref Game); }
public Score(NewGame game) { this.game = game; }
public CPU_Paddle(NewGame game) : base(game) { Velocity = Vector2.Zero; }
public User(ref GameApplication App, ref NewGame Game) : base(App) { }
public CPUPaddle(ref GameApplication App, ref NewGame Game) : base(ref App, ref Game) { this.Velocity = Vector2.Zero; }