Ejemplo n.º 1
0
        public Trap(int initialX, int initialY, Texture2D texture, int frames, int spriteHeight, int spriteWidth, int preyHeight,
                    float boundingRadius, Wyrm predator, float damagedone, Texture2D explosionTex)
            : base(initialX, initialY, texture, frames, spriteHeight, spriteWidth, preyHeight, boundingRadius, predator, 0, 0)
        {
            asSprite = new AnimatedSprite(texture, 0, 0, spriteWidth, spriteHeight, frames);
            asSprite.IsAnimating = true;

            isMine = true;

            damageDone = damagedone;

            explosionTexture = explosionTex;
        }
Ejemplo n.º 2
0
        //Constructor
        public Player(int ID, List<Texture2D> wyrmTextures, SpriteFont font, Texture2D healthBase, Texture2D health, Texture2D stam, Texture2D regBar)
        {
            i_playerID = ID;

            //Create a Wyrm
            theWyrm = new Wyrm(100, 400, wyrmTextures, Game1.WYRMSEGS);

            scoreFont = font;

            hb_base = healthBase;
            healthBar = health;
            staminaBar = stam;
            stamina = staminaMax;
            regenBar = regBar;
        }
Ejemplo n.º 3
0
        public Vehicle(int initialX, int initialY, Texture2D texture, int frames, int spriteHeight, int spriteWidth, int preyHeight,
                    float boundingRadius, Wyrm predator, int meat, int facingY, Texture2D bulletTex)
            : base(initialX, initialY, texture, frames, spriteHeight, spriteWidth, preyHeight, boundingRadius, predator, meat, facingY)
        {
            asSprite = new AnimatedSprite(texture, 0, 0, 145, 50, 0);
            asSprite.IsAnimating = false;

            otherFacing = facingY;

            if (Game1.m_random.NextDouble() < 0.5)
                xVel = -1;
            else
                xVel = 1;

            bulletTexture = bulletTex;
        }
Ejemplo n.º 4
0
        public Animal(int initialX, int initialY, Texture2D texture, int frames, int spriteHeight, int spriteWidth, int preyHeight,
                      float boundingRadius, Wyrm predator, bool isHuman, int meat, int facingY)
            : base(initialX, initialY, texture, frames, spriteHeight, spriteWidth, preyHeight, boundingRadius, predator, meat, facingY)
        {
            asSprite = new AnimatedSprite(preyTexture, 0, 0, spritewidth, spriteheight, animationFrames);
            asSprite.IsAnimating = true;

            human = isHuman;

            otherFacing = facingY;

            if (Game1.m_random.NextDouble() < 0.5)
                xVel = -1;
            else
                xVel = 1;
        }
Ejemplo n.º 5
0
        public SoldierHuman(int initialX, int initialY, Texture2D texture, int frames, int spriteHeight, int spriteWidth, int preyHeight,
                    float boundingRadius, Wyrm predator, int meat, int facingY, int shootingLeftY, int shootingRightY, Texture2D bulletTex)
            : base(initialX, initialY, texture, frames, spriteHeight, spriteWidth, preyHeight, boundingRadius, predator, meat, facingY)
        {
            asSprite = new AnimatedSprite(texture, 0, 0, spriteWidth, spriteHeight, frames);
            asSprite.IsAnimating = true;

            otherFacing = facingY;

            if (Game1.m_random.NextDouble() < 0.5)
                xVel = -1;
            else
                xVel = 1;

            shootingRightFacingY = shootingRightY;
            shootingLeftFacingY = shootingLeftY;

            bulletTexture = bulletTex;
        }
Ejemplo n.º 6
0
        protected int yPos; //The y position of the prey, measured in the center

        #endregion Fields

        #region Constructors

        public Prey(int initialX, int initialY, Texture2D texture, int frames, int spriteHeight, int spriteWidth, int preyHeight,
                    float boundingRadius, Wyrm predator, int meat, int facingY)
        {
            xPos = initialX;
            yPos = initialY;

            preyTexture = texture;
            animationFrames = frames;

            spriteheight = spriteHeight;
            spritewidth = spriteWidth;
            preyheight = preyHeight;
            boundingradius = boundingRadius;

            theWyrm = predator;

            meatReward = meat;

            basepoint = new Vector2(initialX, initialY + spriteheight / 2);
            footpoint = new Vector2(initialX, initialY + preyheight / 2);
        }
Ejemplo n.º 7
0
        public Engineer(int initialX, int initialY, Texture2D texture, int frames, int spriteHeight, int spriteWidth, int preyHeight,
                    float boundingRadius, Wyrm predator, int meat, int facingY, int mineLeftY, int mineRightY, Texture2D mineTex)
            : base(initialX, initialY, texture, frames, spriteHeight, spriteWidth, preyHeight, boundingRadius, predator, meat, facingY)
        {
            asSprite = new AnimatedSprite(texture, 0, 0, spriteWidth, spriteHeight, frames);
            asSprite.IsAnimating = true;

            otherFacing = facingY;

            if (Game1.m_random.NextDouble() < 0.5)
                xVel = -1;
            else
                xVel = 1;

            mineRightFacingY = mineRightY;
            mineLeftFacingY = mineLeftY;

            mineTexture = mineTex;

            mineLayTarget = MathHelper.Clamp((float)(Game1.m_random.NextDouble() * MAXTIMETOMINE), MINTIMETOMINE, MAXTIMETOMINE);
        }