예제 #1
0
        public void LoadContent(ContentManager Content)
        {
            bombTex = Content.Load<Texture2D>("Images/Game/bomb");
            blockTex = Content.Load<Texture2D>("Images/Game/softblocks");
            loaded = true;

            powerupTex = new Texture2D[3];

            powerupTex[0] = Content.Load<Texture2D>("Images/Game/bombup");
            powerupTex[1] = Content.Load<Texture2D>("Images/Game/fireup");
            powerupTex[2] = Content.Load<Texture2D>("Images/Game/speedup");

            AnimationSheet destroySoftblockAnimationSheet = new AnimationSheet();
            destroySoftblockAnimationSheet.Load(Content, "Spritesheets\\softblocks");
            destroySoftblockAnimation = new AnimatedSprite(destroySoftblockAnimationSheet, "Block1");

            powerupSound = Content.Load<SoundEffect>("SFX/powerup");
            bombExplosionSound = Content.Load<SoundEffect>("SFX/bombexplode");

            powerupSoundInstance = powerupSound.CreateInstance();
            bombExplosionSoundInstance = bombExplosionSound.CreateInstance();

            powerupSoundInstance.Volume = GlobalGameData.SFXVolume;
            bombExplosionSoundInstance.Volume = GlobalGameData.SFXVolume;
        }
예제 #2
0
        public void LoadContent(ContentManager Content)
        {
            AnimationSheet playerSheet = new AnimationSheet();
            playerSheet.Load(Content, "Spritesheets\\players");
            playerAnimations = new AnimatedSprite(playerSheet, "StandDown");
            playerAnimations.SetTexture("player" + (playerIndex + 1));

            footstepSound = Content.Load<SoundEffect>("SFX/footsteps");
            bombPlaceSound = Content.Load<SoundEffect>("SFX/bombplace");
        }
예제 #3
0
        public override void LoadContent(ContentManager Content)
        {
            bgtex.SetTexture(Content.Load<Texture2D>("Images/Menu/bg"));
            winTextFont = Content.Load<SpriteFont>("Fonts/Badaboom");

            AnimationSheet winSheet = new AnimationSheet();
            winSheet.Load(Content, "Spritesheets\\winsprite");

            playerWinAnimation = new AnimatedSprite(winSheet, "Win");
            playerWinAnimation.position = new Vector2(GlobalGameData.windowWidth / 2, GlobalGameData.windowHeight / 2);
            playerWinAnimation.frameRate = 2;

            winSong = Content.Load<Song>("Music/victory");
        }
예제 #4
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="sheet">the animation sheet to use</param>
        /// <param name="animation">the start animation</param>
        public AnimatedSprite(AnimationSheet sheet, string animation)
            : this()
        {
            animationSheet = sheet;
            //animationNode = new AnimationNode();
            //animationNode.currentAnimation = animation;
            currentAnimation = animationSheet.GetAnimation(animation);

            scale = animationSheet.defaultScale;
            //size = animationSheet.defaultSpriteSize;
            frameRate = animationSheet.defaultFrameRate;

            currentTexture = animationSheet.textures.First().Value;
        }
예제 #5
0
        public void LoadContent(ContentManager Content)
        {
            aesthetics.LoadContent(Content);
            aesthetics.GenerateTiles(solidArea);

            tileObjectManager.LoadContent(Content);

            AnimationSheet playerDeathAnimationSheet = new AnimationSheet();
            playerDeathAnimationSheet.Load(Content, "Spritesheets\\deathsprite");
            playerDeathAnimation = new AnimatedSprite(playerDeathAnimationSheet, "Death");

            playerDeathSound = Content.Load<SoundEffect>("SFX/death");

            for (int i = 0; i < 4; ++i)
            {
                playerDeathSoundInstance[i] = playerDeathSound.CreateInstance();
                playerDeathSoundInstance[i].Volume = GlobalGameData.SFXVolume;
            }

            for (int i = 0; i < 4; ++i)
            {
                players[i].LoadContent(Content);
            }

            fireManager.SetSolidArea(solidArea);
        }
예제 #6
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="sprite">AnimatedSprite to copy</param>
        public AnimatedSprite(AnimatedSprite sprite)
            : this()
        {
            animationSheet = sprite.animationSheet;
            currentAnimation = sprite.currentAnimation;
            currentTexture = sprite.currentTexture;

            scale = sprite.animationSheet.defaultScale;
            frameRate = sprite.animationSheet.defaultFrameRate;
        }