예제 #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
예제 #2
0
 public Camera(PlayerIndex player, Game1 game)
 {
     position = Vector2.Zero;
     desiredPosition = Vector2.Zero;
     scale = desiredScale = 1f;
     matrix = Matrix.Identity;
     this.player = player;
     this.game = game;
 }
예제 #3
0
 public SplashScreen(Game1 game)
     : base(game)
 {
     bg1Pos = new Vector2(Game1.SCREENWIDTH/2 - Game1.IMAGE_ANVIL.Width/2, Game1.SCREENHEIGHT/2 - Game1.IMAGE_ANVIL.Height/2);
     titleAlpha = 0;
     alphaFlip = 0;
     timer = 0;
     anvil = false;
 }
예제 #4
0
 public MenuScreen(Game1 game)
     : base(game)
 {
     bg1Pos = Vector2.Zero;
     bg2Pos = new Vector2(-Game1.SCREENWIDTH, 0);
     titleAlpha = 255;
     alphaFlip = false;
     timer = 0;
     previousKeyboardState = Keyboard.GetState();
     previousGamePadState = GamePad.GetState(PlayerIndex.One, GamePadDeadZone.Circular);
 }
예제 #5
0
        public DuelScreen(Game1 game, PlayerIndex player)
            : base(game)
        {
            movementVector = Vector2.Zero;
            accellerationVector = Vector2.Zero;
            gun = new Gun(player);
            arm = new Arm(gun);
            P1Score = new Score(this);
            bullets = 6;
            firedBullets = new ArrayList(12);
            textPopups = new ArrayList(20);
            this.player = player;
            this.dead = false;
            this.droppedGun = false;
            this.droppedGunTimer = 0f;
            this.won = false;
            this.deathTimer = 0f;
            dropping = false;

            this.fallForces = new Vector2[8];
            Random rand = new Random();
            for (int i = 0; i < 8; i++)
            {
                fallForces[i] = new Vector2(rand.Next(5), rand.Next(10));
                //fallForces[i].X *= rand.Next(2) == 0 ? -1 : 1;
                fallForces[i].X += 5;
            }

            //set up cowboy body parts drawing locations
            if (player == PlayerIndex.One)
            {
                leftArmPos = new Vector2(280, 275);
                bodyPos = new Vector2(148, 240);
                headPos = new Vector2(245, 157);
                leftLegPos = new Vector2(216, 430);
                rightLegPos = new Vector2(36, 430);
                holsterPos = new Vector2(140, 418);

                leftArmText = Game1.IMAGE_LEFTARM;
                bodyText = Game1.IMAGE_BODY;
                headText = Game1.IMAGE_HEAD;
                leftLegText = Game1.IMAGE_LEFTLEG;
                rightLegText = Game1.IMAGE_RIGHTLEG;
                holsterText = Game1.IMAGE_HOLSTER;

                camera = game.p1Camera;
            }
            else
            {
                leftArmPos = new Vector2(280, 238);
                bodyPos = new Vector2(45, 192);
                headPos = new Vector2(245, 157);
                leftLegPos = new Vector2(30, 440);
                rightLegPos = new Vector2(206, 428);
                holsterPos = new Vector2(140, 418);

                leftArmText = Game1.IMAGE_LEFTARM2;
                bodyText = Game1.IMAGE_BODY2;
                headText = Game1.IMAGE_HEAD2;
                leftLegText = Game1.IMAGE_LEFTLEG2;
                rightLegText = Game1.IMAGE_RIGHTLEG2;
                holsterText = Game1.IMAGE_HOLSTER2;

                camera = game.p2Camera;
            }
        }
예제 #6
0
 public GameScreen(Game1 game)
 {
     this.game = game;
 }