예제 #1
0
        // Create initial data objects here
        public Actor(GameApp game)
        {
            this.game = game;              // Do not remove this line!

            // Add your initialisations below this comment

            powerBar   = new Rectangle(powerBarPos, 600 - 40, 0, 20, powerColor);
            powerBarBg = new Rectangle(powerBarPos + (maxForce * powerMulti) / 2, 600 - 40, maxForce * powerMulti, 26);

            target1     = new GameObject();
            target1.Box = new Rectangle(400, 400, 50, 50);
            gameObjects.Add(target1);

            body   = new Circle(tank_Position.x, tank_Position.y, 25);
            barrel = new Rectangle(body.X, body.Y, 150, 10);
            game.AddDrawable(body);
            game.AddDrawable(barrel);
            game.AddDrawable(powerBarBg);
            game.AddDrawable(powerBar);
            game.AddDrawable(target1.Box);
        }
예제 #2
0
파일: Actor.cs 프로젝트: kvicksilv3r/physx
        // Create initial data objects here
        public Actor(GameApp game)
        {
            this.game = game;              // Do not remove this line!

            // Add your initialisations below this comment

            Console.WriteLine("Aim the cannon with left and right arrow keys");
            Console.WriteLine("Hold down space to adjust power. Release to shoot");

            bluePortal        = new GameObject("portal2");
            bluePortal.Box    = new Rectangle(40, 450, 50, 200, colorBlue);
            bluePortal.Active = false;
            game.AddDrawable(bluePortal.Box);
            gameObjects.Add(bluePortal);

            orangePortal        = new GameObject("portal");
            orangePortal.Active = false;
            orangePortal.Box    = new Rectangle(1240, 450, 50, 200, colorOrange);
            game.AddDrawable(orangePortal.Box);
            gameObjects.Add(orangePortal);

            powerBar   = new Rectangle(powerBarPos, game.DefaultHeight - 40, 0, 20, colorRed);
            powerBarBg = new Rectangle(-4 + powerBarPos + (maxForce * powerBarLength) / 2, game.DefaultHeight - 40, maxForce * powerBarLength, 26);

            body   = new Circle(cannonPosition.x, cannonPosition.y, 25);
            barrel = new Rectangle(body.X, body.Y, 150, 10);
            game.AddDrawable(body);
            game.AddDrawable(barrel);
            game.AddDrawable(powerBarBg);
            game.AddDrawable(powerBar);
        }