public AnimatedSpriteComponent(Rectangle myPosition, Texture2DFramed myTex)
     : base(myPosition, myTex)
 {
     //Setting how fast it animates
     if (myTex.animationSpeed != 0)
     {
         maxAnimationTimer = myTex.animationSpeed;//If you passed in a value
     }
 }
Beispiel #2
0
 // What should this have to change the player's attributes?
 public Weapon(string myName, int dmg,float  myAttackSpeed, int mvsp, int rnge, int bred, int life, Texture2DFramed spr)
 {
     name = myName;
     damage = dmg;
     attackSpeed = myAttackSpeed;
     moveSpeed = mvsp;
     range = rnge;
     breadth = bred;
     health = life;
     sprite = spr;
 }
        public SpriteSheetComponent(Rectangle myPosition, Texture2DFramed myTex)
        {
            Position = myPosition;
            Texture = myTex.texture;

            FrameWidth = myTex.frameWidth;
            FrameHeight = myTex.frameHeight;

            source = new Rectangle((int)frameInRow * FrameWidth, (int)row * FrameHeight, FrameWidth, FrameHeight);

            framesPerRow = myTex.FramesPerRow;
        }
Beispiel #4
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            shadeTexture = Content.Load<Texture2D>("Graphics/shadow");
            arrowTexture = Content.Load<Texture2D>("Graphics/UI/arrow");

            missingGraphicSquare = Content.Load<Texture2D>("Graphics/MissingGraphics/missingGraphicSquare");
            missingGraphicTall = Content.Load<Texture2D>("Graphics/MissingGraphics/missingGraphicSquare");
            missingGraphicWide = Content.Load<Texture2D>("Graphics/MissingGraphics/missingGraphicWide");

            //World Grpahics
            tileSheet = new Texture2DFramed(Content.Load<Texture2D>("Graphics/tilesSpriteSheet"), 50, 50);

            //Player Graphics
            greatAxeTexture = new Texture2DFramed(Content.Load<Texture2D>("Graphics/Combatants/axe"), 120, new int[] { 6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               1});
            swordTexture = new Texture2DFramed(Content.Load<Texture2D>("Graphics/Combatants/sword"), 120, new int[] { 6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               1});
            spearTexture = new Texture2DFramed(Content.Load<Texture2D>("Graphics/Combatants/spear"), 120, new int[] { 6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               1});
            maceTexture = new Texture2DFramed(Content.Load<Texture2D>("Graphics/Combatants/mace"), 120, new int[] { 6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               6, 6, 6,
                                                                                                               1});

            healthBarTexture = Content.Load<Texture2D>("Graphics/UI/healthBlock");
            healthBarMissingTexture = Content.Load<Texture2D>("Graphics/UI/missingHealthBlock");

            //Attack Animations
            axeAttackAnimation = new Texture2DFramed(Content.Load<Texture2D>("Graphics/AttackAnimations/axeSlash"), 50, 50);
            swordAttackAnimation = new Texture2DFramed(Content.Load<Texture2D>("Graphics/AttackAnimations/swordSlash"), 50, 50);
            spearAttackAnimation = new Texture2DFramed(Content.Load<Texture2D>("Graphics/AttackAnimations/spearSlash"), 50, 50);
            maceAttackAnimation = new Texture2DFramed(Content.Load<Texture2D>("Graphics/AttackAnimations/maceSlash"), 50, 50);

            //Enemy
            enemyTexture = new Texture2DFramed(Content.Load<Texture2D>("enemy"), 50, new int[] { 6, 6, 6, 4, 2, 5, 6 });
            selectedGraphic = Content.Load<Texture2D>("Graphics/MissingGraphics/selected");

            //Backgrounds
            collBackgroundTexture = Content.Load<Texture2D>("Graphics/Backgrounds/background");

            //Fonts
            menuFont = Content.Load<SpriteFont>("Fonts/mainFont");
            alphabetTextureFramed = new Texture2DFramed(Content.Load<Texture2D>("Fonts/alphabetSpriteSheet"), 50, 50);

            //Sounds
            clickSound = Content.Load<SoundEffect>("Sounds/click");
            waveEndSound = Content.Load<SoundEffect>("Sounds/waveEnd");
            firstWaveSound = Content.Load<SoundEffect>("Sounds/waveEnd");
            newWaveSound = Content.Load<SoundEffect>("Sounds/waveEnd");

            enemyDeathSound  = Content.Load<SoundEffect>("Sounds/deathgroan");
            bossDyingSound   = Content.Load<SoundEffect>("Sounds/bossDying");
            gateOpeningSound = Content.Load<SoundEffect>("Sounds/gateOpening");
            bossEnterSound   = Content.Load<SoundEffect>("Sounds/bossEnter");
            greatAxeSound    = Content.Load<SoundEffect>("Sounds/greatAxeSound");
            spearSound       = Content.Load<SoundEffect>("Sounds/spearSound");
            swordSound       = Content.Load<SoundEffect>("Sounds/swish");
            maceSound        = Content.Load<SoundEffect>("Sounds/mace");
            playerHitSound   = Content.Load<SoundEffect>("Sounds/ugh");
            playerDeathSound = Content.Load<SoundEffect>("Sounds/myLeg");
        }