Beispiel #1
0
 /// <summary>
 /// The application's entry point.
 /// </summary>
 /// <param name="args">An array containing the application's command line arguments.</param>
 public static void Main(String[] args)
 {
     using (var game = new Breakout())
     {
         game.Run();
     }
 }
Beispiel #2
0
 static void Main(string[] args)
 {
     using (Breakout breakout = new Breakout())
     {
         breakout.Run();
     }
 }
Beispiel #3
0
        public static void Main(string[] args)
        {
            Breakout breakout = new Breakout();

            breakout.Init();
            breakout.Run();
        }
Beispiel #4
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Breakout game = new Breakout())
     {
         game.Run();
     }
 }
Beispiel #5
0
        private void ContinueButton_Click(object sender, EventArgs e)
        {
            Breakout game = new Breakout();

            game.Show();
            this.Close();
        }
Beispiel #6
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Breakout game = new Breakout())
     {
         game.Run();
     }
 }
Beispiel #7
0
 public void Subscribe(Breakout theGame)
 {
     // theGame.BallLaunch += new Breakout.BallLaunchHandler(HasLaunched);
     theGame.Launch            += HasLaunched;
     theGame.CollideWithBorder += HasCollidedWithBorder;
     theGame.CollideWithBrick  += HasCollidedWithBrick;
     theGame.CollideWithBat    += HasCollidedWithBat;
 }
Beispiel #8
0
            public KeyboardManager(Breakout breakout)
            {
                this.textBox          = new TextBox();
                this.textBox.Location = new Point(99999, 99999);

                this.textBox.Parent = breakout;

                this.textBox.KeyDown += this.OnKeyDown;
                this.textBox.KeyUp   += this.OnKeyUp;
            }
Beispiel #9
0
 public Paddle(Breakout breakout, int x, int y, int paddleWidth, int paddleHeight)
 {
     this.breakout         = breakout;
     this.paddle           = new PictureBox();
     this.paddle.Parent    = this.breakout;
     this.paddle.Location  = new Point(x, y);
     this.paddle.Height    = paddleHeight;
     this.paddle.Width     = paddleWidth;
     this.paddle.BackColor = this.paddleColor;
     this.restrictions     = new BoxRestrictions(this.paddle.Left, this.paddle.Top, this.paddle.Width, this.paddle.Height);
 }
Beispiel #10
0
            public Brick(Breakout breakout, int x, int y, int brickWidth, int brickHeight, Color brickColor, int colorValue)
            {
                this.breakout = breakout;
                this.brick    = new PictureBox();

                this.brick.Parent    = this.breakout;
                this.brick.Location  = new Point(x, y);
                this.brick.Height    = brickHeight;
                this.brick.Width     = brickWidth;
                this.brick.BackColor = brickColor;
                this.colorValue      = colorValue;
                this.restrictions    = new BoxRestrictions(this.brick.Left, this.brick.Top, this.brick.Width, this.brick.Height);
            }
Beispiel #11
0
 public Ball(Breakout breakout, int x, int y, int ballWidth, int ballHeight)
 {
     this.breakout     = breakout;
     this.ball         = new PictureBox();
     this.ball.Parent  = this.breakout;
     this.ball.Left    = x;
     this.ball.Top     = y;
     this.ball.Height  = ballHeight;
     this.ball.Width   = ballWidth;
     this.ballImage    = new Bitmap(Image.FromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "blue.png")), this.ball.Height, this.ball.Width);
     this.ball.Image   = this.ballImage;
     this.velocity     = new XY(3.0, -4.0);
     this.restrictions = new BoxRestrictions(this.ball.Left, this.ball.Top, this.ball.Width, this.ball.Height);
 }
Beispiel #12
0
        public static void Main()
        {
            Window   gameWindow = new Window("Breakout: Opposition", 800, 800);
            Breakout game       = new Breakout(gameWindow);

            game.Initialize();

            while (!gameWindow.CloseRequested && !game.IsGameOver)
            {
                game.HandleInput();
                game.CheckCollision();
                game.Update();
                game.Draw();
            }
        }
Beispiel #13
0
        public void HasLaunched(Object sender, EventArgs e)
        {
            if (IsStandby)
            {
                Breakout game    = (Breakout)sender;
                Random   random  = new Random();
                var      randomX = random.Next(0, game.GameWindow.Width);
                Point2D  fromPt  = new Point2D()
                {
                    X = X, Y = Y
                };
                Point2D toPt = new Point2D()
                {
                    X = randomX, Y = 100
                };

                Vector2D dir = SplashKit.UnitVector(SplashKit.VectorPointToPoint(fromPt, toPt));
                Velocity = SplashKit.VectorMultiply(dir, Constants.BallSpeed);

                IsStandby = false;

                Console.WriteLine(this.GetType().Name + " Launched");
            }
        }
Beispiel #14
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     breakout = new Breakout(new SpriteBatch(GraphicsDevice));
     base.Initialize();
 }
Beispiel #15
0
 static void Main()
 {
     using (var game = new Breakout())
         game.Run();
 }
Beispiel #16
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     breakout = new Breakout(new SpriteBatch(GraphicsDevice));
     base.Initialize();
 }
Beispiel #17
0
 static void Main()
 {
     using (var game = new Breakout())
         game.Run();
 }