コード例 #1
0
ファイル: Game.cs プロジェクト: VoodooLlama/breakout-clone
 /// <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();
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: heidar/Breakout
 static void Main(string[] args)
 {
     using (Breakout breakout = new Breakout())
     {
         breakout.Run();
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: Jannek312/Breakout
        public static void Main(string[] args)
        {
            Breakout breakout = new Breakout();

            breakout.Init();
            breakout.Run();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: alexluke/breakout-xna
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Breakout game = new Breakout())
     {
         game.Run();
     }
 }
コード例 #5
0
        private void ContinueButton_Click(object sender, EventArgs e)
        {
            Breakout game = new Breakout();

            game.Show();
            this.Close();
        }
コード例 #6
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Breakout game = new Breakout())
     {
         game.Run();
     }
 }
コード例 #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;
 }
コード例 #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;
            }
コード例 #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);
 }
コード例 #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);
            }
コード例 #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);
 }
コード例 #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();
            }
        }
コード例 #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");
            }
        }
コード例 #14
0
ファイル: BreakoutGame.cs プロジェクト: seangeo/breakout
 /// <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();
 }
コード例 #15
0
ファイル: Program.cs プロジェクト: jasongdove/BreakoutClone
 static void Main()
 {
     using (var game = new Breakout())
         game.Run();
 }
コード例 #16
0
ファイル: BreakoutGame.cs プロジェクト: d3nd3/breakout
 /// <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();
 }
コード例 #17
0
 static void Main()
 {
     using (var game = new Breakout())
         game.Run();
 }