Ejemplo n.º 1
0
        public Hunter(PlayerIndex index, Texture2D backTexture, Texture2D frontTexture, int health, string damageSound, int air, Sprite sprite, uint collisionDamage, float speed, Texture2D bulletTexture, string shotSound, Vector2 shotOffset, int bulletHits, uint bulletDamage, float bulletSpeed, float shotTime)
            : base(index, backTexture, frontTexture, health, damageSound, sprite, collisionDamage, speed, true, true, bulletTexture, shotOffset, bulletHits, bulletDamage, bulletSpeed, shotTime)
        {
            this.air = new StatBar(air);
            if (air == 0)
                airEnabled = false;

            this.shotSound = shotSound;

            invTime = 0.4f;
        }
Ejemplo n.º 2
0
        protected virtual void DrawBar(SpriteBatch spriteBatch, StatBar b, Color color, EntityManager manager)
        {
            Texture2D backTexture  = manager.BackBarTexture;
            Texture2D frontTexture = manager.FrontBarTexture;

            int x = (int)sprite.Center.X - backTexture.Width / 2;
            int y = sprite.BoundingBoxRect.Y - backTexture.Height;

            Rectangle backRect  = new Rectangle(x, y, (int)(backTexture.Width * b.Fraction), backTexture.Height);
            Rectangle frontRect = new Rectangle(x, y, frontTexture.Width, frontTexture.Height);

            spriteBatch.Draw(manager.BackBarTexture, backRect, null, color, 0f, Vector2.Zero, SpriteEffects.None, 0.1f);
            spriteBatch.Draw(manager.FrontBarTexture, frontRect, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0f);
        }
Ejemplo n.º 3
0
        public Entity(string tag, string group, int _health, string damageSound, 
            Sprite _sprite, bool _collides, uint _collisionDamage, params string[] _collisionGroups)
        {
            Tag = tag;
            Group = group;
            health = new StatBar(_health);
            this.damageSound = damageSound;
            sprite = _sprite;
            collides = _collides;
            collisionDamage = _collisionDamage;

            foreach (string s in _collisionGroups)
            {
                collisionGroups.Add(s);
            }
        }
Ejemplo n.º 4
0
        public Entity(string tag, string group, int _health, string damageSound,
                      Sprite _sprite, bool _collides, uint _collisionDamage, params string[] _collisionGroups)
        {
            Tag              = tag;
            Group            = group;
            health           = new StatBar(_health);
            this.damageSound = damageSound;
            sprite           = _sprite;
            collides         = _collides;
            collisionDamage  = _collisionDamage;

            foreach (string s in _collisionGroups)
            {
                collisionGroups.Add(s);
            }
        }
Ejemplo n.º 5
0
 protected override void DrawBar(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, StatBar b, Color color, EntityManager manager)
 {
 }
Ejemplo n.º 6
0
 protected override void DrawBar(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, StatBar b, Color color, EntityManager manager)
 {
 }
Ejemplo n.º 7
0
        protected void DrawTheBar(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, StatBar b, Color color)
        {
            int x = (int)statBarX;
            #if WINDOWS
            int y = (int)(ScreenHelper.Viewport.Height - 32 - barTextureFront.Height);
            #endif
            #if XBOX
            int y = (int)(ScreenHelper.TitleSafeArea.Bottom - barTextureFront.Height);
            #endif

            statBarX += barTextureBack.Width + barTextureBack.Width / 8;

            Rectangle backRect = new Rectangle(x, y, (int)(barTextureBack.Width * b.Fraction), barTextureBack.Height);
            Rectangle frontRect = new Rectangle(x, y, barTextureFront.Width, barTextureFront.Height);

            spriteBatch.Draw(barTextureBack, backRect, null, color, 0f, Vector2.Zero, SpriteEffects.None, 0f);
            spriteBatch.Draw(barTextureFront, frontRect, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0f);
        }
Ejemplo n.º 8
0
        protected virtual void DrawBar(SpriteBatch spriteBatch, StatBar b, Color color, EntityManager manager)
        {
            Texture2D backTexture = manager.BackBarTexture;
            Texture2D frontTexture = manager.FrontBarTexture;

            int x = (int)sprite.Center.X - backTexture.Width / 2;
            int y = sprite.BoundingBoxRect.Y - backTexture.Height;

            Rectangle backRect = new Rectangle(x, y, (int)(backTexture.Width * b.Fraction), backTexture.Height);
            Rectangle frontRect = new Rectangle(x, y, frontTexture.Width, frontTexture.Height);

            spriteBatch.Draw(manager.BackBarTexture, backRect, null, color, 0f, Vector2.Zero, SpriteEffects.None, 0.1f);
            spriteBatch.Draw(manager.FrontBarTexture, frontRect, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0f);
        }
Ejemplo n.º 9
0
        protected void DrawTheBar(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, StatBar b, Color color)
        {
            int x = (int)statBarX;

#if WINDOWS
            int y = (int)(ScreenHelper.Viewport.Height - 32 - barTextureFront.Height);
#endif
#if XBOX
            int y = (int)(ScreenHelper.TitleSafeArea.Bottom - barTextureFront.Height);
#endif

            statBarX += barTextureBack.Width + barTextureBack.Width / 8;

            Rectangle backRect  = new Rectangle(x, y, (int)(barTextureBack.Width * b.Fraction), barTextureBack.Height);
            Rectangle frontRect = new Rectangle(x, y, barTextureFront.Width, barTextureFront.Height);

            spriteBatch.Draw(barTextureBack, backRect, null, color, 0f, Vector2.Zero, SpriteEffects.None, 0f);
            spriteBatch.Draw(barTextureFront, frontRect, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0f);
        }