示例#1
0
        /// <summary>
        /// Loads the player textures and bounding box
        /// </summary>
        public void LoadContent()
        {
            flyTexture = new Texture2D[]
            {
                BaseGame.Content.Load <Texture2D>("fly1"),
                BaseGame.Content.Load <Texture2D>("fly2")
            };
            BaseTexture = BaseGame.Content.Load <Texture2D>("dead");

            Size         = new Vector2(BaseTexture.Width * ScaleFactor, BaseTexture.Height * ScaleFactor);
            CollisionBox = new CollisionHelper.BoundingRectangle(Position, Size * 0.5f);
        }
示例#2
0
        /// <summary>
        /// Loads the missile textures, sounds, and bounding box
        /// </summary>
        private void LoadContent()
        {
            BaseTexture      = BaseGame.Content.Load <Texture2D>("missile");
            explosionTexture = new Texture2D[]
            {
                BaseGame.Content.Load <Texture2D>("explosion0"),
                BaseGame.Content.Load <Texture2D>("explosion1"),
                BaseGame.Content.Load <Texture2D>("explosion2"),
                BaseGame.Content.Load <Texture2D>("explosion3"),
                BaseGame.Content.Load <Texture2D>("explosion4"),
                BaseGame.Content.Load <Texture2D>("explosion5"),
                BaseGame.Content.Load <Texture2D>("explosion6"),
                BaseGame.Content.Load <Texture2D>("explosion7"),
                BaseGame.Content.Load <Texture2D>("explosion8")
            };

            explosionSound = BaseGame.Content.Load <SoundEffect>("explode");

            Size         = new Vector2(BaseTexture.Width * ScaleFactor, BaseTexture.Height * ScaleFactor);
            CollisionBox = new CollisionHelper.BoundingRectangle(Position, Size * 0.5f);
        }