Пример #1
0
 public Bullet(Texture2D texture)
 {
     asRight = new AnimatedSprite(texture, 0, 0, 16, 1, 1);
     asRight.IsAnimating = false;
     asLeft = new AnimatedSprite(texture, 16, 0, 16, 1, 1);
     asRight.IsAnimating = false;
     iFacing = 0;
     iX = 0;
     iY = 0;
     bActive = false;
 }
Пример #2
0
 public Enemy(Texture2D texture,
     int X, int Y, int W, int H, int Frames)
 {
     asSprite = new AnimatedSprite(texture, X, Y, W, H, Frames);
 }
Пример #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            //
            //Explosion
            Explosion = new AnimatedSprite(
                Content.Load<Texture2D>(@"Textures\Explosions"),
                0, 0, 64, 64, 16);
            Explosion.X = 0;
            Explosion.Y = 0;
            //
            //Background
            background = new Background(
                Content,
                @"Textures\PrimaryBackground",
                @"Textures\ParallaxStars");
            //
            //Player
            player = new Player(Content.Load<Texture2D>(@"Textures\PlayerShip"));
            //
            //Bullets
            bullets[0] = new Bullet(Content.Load<Texture2D>(@"Textures\PlayerBullet"));

            for (int x = 1; x < iMaxBullets; x++)
                bullets[x] = new Bullet();
            //
            //Enemies
            t2dEnemyShip = Content.Load<Texture2D>(@"Textures\enemy");

            for (int i = 0; i < iTotalMaxEnemies; i++)
            {
                Enemies[i] = new Enemy(t2dEnemyShip, 0, 0, 32, 32, 1);
            }

            StartNewWave();

            // TODO: use this.Content to load your game content here
        }
Пример #4
0
 public Player(Texture2D texture)
 {
     asSprite = new AnimatedSprite(texture, 0, 0, 72, 16, 4);
     asSprite.IsAnimating = false;
 }