Exemplo n.º 1
0
 public void Attack()
 {
     Sprite       = new StaticSprite(Game, "BombEffect", Position, Game.EffectSpriteSheet, Game.spriteBatch);
     Sprite.FPS   = 3;
     Sprite.Layer = 0.25f;
     Game.CurrDungeon.Attacks.Add(this);
 }
Exemplo n.º 2
0
 public Item(Game1 game, string spriteName, string itemName, Vector2 spawn)
 {
     Game     = game;
     Sprite   = new StaticSprite(game, spriteName, spawn, game.ItemSpriteSheet, game.spriteBatch);
     Position = spawn;
     ItemName = itemName;
 }
Exemplo n.º 3
0
        private void SetupAttack()
        {
            velocity = Vector2.Zero;
            Vector2 offset = Vector2.Zero;

            switch (Direction)
            {
            case (States.Direction.Down):
                offset.Y  += 16;
                velocity.Y = 0.25f;
                break;

            case (States.Direction.Up):
                offset.Y  -= 16;
                velocity.Y = -0.25f;
                break;

            case (States.Direction.Left):
                offset.X  -= 16;
                velocity.X = -0.25f;
                break;

            case (States.Direction.Right):
                offset.X  += 16;
                velocity.X = 0.25f;
                break;

            default:
                break;
            }

            Position    += offset;
            Sprite       = new StaticSprite(Game, "FireEffect", Position, Game.EffectSpriteSheet, Game.spriteBatch);
            Sprite.Layer = 0.25f;
        }
Exemplo n.º 4
0
 public BladeTrap(Game1 game, Vector2 spawn)
 {
     Game     = game;
     Sprite   = new StaticSprite(game, "BladeTrap", spawn, game.MonsterSpriteSheet, game.spriteBatch);
     Position = spawn;
     Origin   = Position;
 }
Exemplo n.º 5
0
 public void Attack()
 {
     Sprite       = new StaticSprite(Game, "GreyExplosionEffect", Position, Game.EffectSpriteSheet, Game.spriteBatch);
     Sprite.FPS   = 2;
     Sprite.Layer = 0.9f;
     Game.CurrDungeon.Attacks.Add(this);
 }
Exemplo n.º 6
0
        private void SetupAttack()
        {
            explosions = new StaticSprite[4];
            positions  = new Vector2[4];
            velocities = new Vector2[4];

            for (int i = 0; i < 4; i++)
            {
                explosions[i]       = new StaticSprite(Game, "SwordBeamExplosion", Creator.Position, Game.EffectSpriteSheet, Game.spriteBatch);
                explosions[i].Layer = 0.9f;
                positions[i]        = Position;
            }

            // Upper Right
            explosions[0].SpriteEffect = SpriteEffects.FlipHorizontally;
            velocities[0] = new Vector2(0.5f, -0.5f);

            // Upper Left
            velocities[1] = new Vector2(-0.5f, -0.5f);

            // Lower Right
            velocities[2] = new Vector2(0.5f, 0.5f);
            explosions[2].SpriteEffect = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically;

            // Lower Left
            velocities[3] = new Vector2(-0.5f, 0.5f);
            explosions[3].SpriteEffect = SpriteEffects.FlipVertically;
        }
Exemplo n.º 7
0
 public BeamExplosion(Game1 game, IGameObject creator)
 {
     Game     = game;
     Creator  = creator;
     Position = Creator.Position;
     Damage   = 0;
     Sprite   = new StaticSprite(game, "SwordBeam", new Vector2(0, 0), game.EffectSpriteSheet, game.spriteBatch);
 }
Exemplo n.º 8
0
 public MovableBlock(Game1 game, Vector2 position, States.Direction movableDirection)
 {
     Position         = position;
     Sprite           = new StaticSprite(game, "Block", position, game.TileSpriteSheet, game.spriteBatch);
     Hitbox           = new Rectangle((int)Position.X, (int)Position.Y, (int)Sprite.Size.X, (int)Sprite.Size.Y);
     MovableDirection = movableDirection;
     SetSpeed();
 }
Exemplo n.º 9
0
        public void Attack()
        {
            Tuple <string, SpriteEffects> swordInfo = SwordSpriteHelper();

            Sprite = new StaticSprite(Game, swordInfo.Item1, Position, Game.EffectSpriteSheet, Game.spriteBatch);
            Sprite.SpriteEffect = swordInfo.Item2;
            Sprite.Layer        = 0.25f;
            Sprite.FPS          = 12;
            Game.CurrDungeon.Attacks.Add(this);
        }
Exemplo n.º 10
0
        private void SetupAttack()
        {
            string        spriteName   = "";
            SpriteEffects spriteEffect = SpriteEffects.None;

            velocity = Vector2.Zero;
            Vector2 offset = Vector2.Zero;

            spriteName          = "Fireball";
            Position           += offset;
            Sprite              = new StaticSprite(Game, spriteName, Position, Game.EffectSpriteSheet, Game.spriteBatch);
            Sprite.Layer        = 0.25f;
            Sprite.FPS          = 16;
            Sprite.SpriteEffect = spriteEffect;
        }
Exemplo n.º 11
0
        private void SetupAttack()
        {
            string        spriteName   = "";
            SpriteEffects spriteEffect = SpriteEffects.None;

            velocity = Vector2.Zero;
            Vector2 offset = Vector2.Zero;

            switch (Direction)
            {
            case (States.Direction.Down):
                Position     = new Vector2(Creator.Position.X + 6, Creator.Position.Y + 12);
                velocity.Y   = 2f;
                spriteName   = "SwordBeam";
                spriteEffect = SpriteEffects.FlipVertically;
                break;

            case (States.Direction.Up):
                Position   = new Vector2(Creator.Position.X + 3, Creator.Position.Y - 12);
                velocity.Y = -2f;
                spriteName = "SwordBeam";
                break;

            case (States.Direction.Left):
                Position   = new Vector2(Creator.Position.X - 12, Creator.Position.Y + 6);
                velocity.X = -2f;
                spriteName = "SwordBeamHorizontal";
                break;

            case (States.Direction.Right):
                Position     = new Vector2(Creator.Position.X + 12, Creator.Position.Y + 6);
                velocity.X   = 2f;
                spriteName   = "SwordBeamHorizontal";
                spriteEffect = SpriteEffects.FlipHorizontally;
                break;

            default:
                break;
            }

            Position           += offset;
            Sprite              = new StaticSprite(Game, spriteName, Position, Game.EffectSpriteSheet, Game.spriteBatch);
            Sprite.Layer        = 0.25f;
            Sprite.FPS          = 16;
            Sprite.SpriteEffect = spriteEffect;
        }
Exemplo n.º 12
0
        private void SetupAttack()
        {
            velocity = Vector2.Zero;
            slowdown = Vector2.Zero;
            Vector2 offset = Vector2.Zero;

            switch (Direction)
            {
            case (States.Direction.Down):
                offset.X  += 4;
                offset.Y  += 14;
                velocity.Y = 3f;
                slowdown.Y = -0.06f;
                break;

            case (States.Direction.Up):
                offset.X  += 4;
                offset.Y  -= 4;
                velocity.Y = -3f;
                slowdown.Y = 0.06f;
                break;

            case (States.Direction.Left):
                offset.X  -= 14;
                offset.Y  += 4;
                velocity.X = -3f;
                slowdown.X = 0.06f;
                break;

            case (States.Direction.Right):
                offset.X  += 14;
                offset.Y  += 4;
                velocity.X = 3f;
                slowdown.X = -0.06f;
                break;

            default:
                break;
            }

            Position    += offset;
            Sprite       = new StaticSprite(Game, "BoomerangEffect", Position, Game.EffectSpriteSheet, Game.spriteBatch);
            Sprite.FPS   = 20;
            Sprite.Layer = 0.55f;
        }
Exemplo n.º 13
0
        private void SetupAttack()
        {
            string        spriteName   = "";
            SpriteEffects spriteEffect = SpriteEffects.None;

            velocity   = Vector2.Zero;
            hitCorrect = Vector2.Zero;

            switch (Direction)
            {
            case (States.Direction.Down):
                Position      = new Vector2(Creator.Position.X + 4, Creator.Position.Y + 12);
                velocity.Y    = 30f;
                spriteName    = "Bullet";
                hitCorrect.Y += 8;
                spriteEffect  = SpriteEffects.FlipVertically;
                break;

            case (States.Direction.Up):
                Position   = new Vector2(Creator.Position.X + 4, Creator.Position.Y - 12);
                velocity.Y = -30f;
                spriteName = "Bullet";
                break;

            case (States.Direction.Left):
                Position   = new Vector2(Creator.Position.X - 12, Creator.Position.Y + 4);
                velocity.X = -30f;
                spriteName = "Bullet";
                break;

            case (States.Direction.Right):
                Position      = new Vector2(Creator.Position.X + 12, Creator.Position.Y + 4);
                velocity.X    = 30f;
                hitCorrect.X += 8;
                spriteName    = "Bullet";
                spriteEffect  = SpriteEffects.FlipHorizontally;
                break;

            default:
                break;
            }
            Sprite              = new StaticSprite(Game, spriteName, Position, Game.EffectSpriteSheet, Game.spriteBatch);
            Sprite.Layer        = 0.25f;
            Sprite.SpriteEffect = spriteEffect;
        }
Exemplo n.º 14
0
 private void CreateSprite()
 {
     Sprite        = new StaticSprite(Game, "ClosedDoor" + Side, Position, Game.TileSpriteSheet, Game.spriteBatch);
     Sprite.Colour = Color.TransparentBlack;
     Sprite.Layer  = 0.5f;
 }
Exemplo n.º 15
0
        private void SetupHUDSprites()
        {
            MainInventory       = new StaticSprite(Game, "HUD", Vector2.Zero, inventoryScreen, Game.spriteBatch);
            MainInventory.Layer = 0.90f;

            MiniMap        = new StaticSprite(Game, "Dungeon01Map", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            MiniMap.Layer  = 0.91f;
            MiniMap.Colour = Color.Black;

            LifeBar = new StaticSprite[16];
            for (int i = 0; i < LifeBar.Length; i++)
            {
                LifeBar[i]       = new StaticSprite(Game, "EmptyHeart", Vector2.Zero, inventoryExtras, Game.spriteBatch);
                LifeBar[i].Layer = 0.92f;
                if (i > 2)
                {
                    LifeBar[i].Colour = Color.Black;
                }
            }

            CurrentLife = new StaticSprite[16];
            for (int i = 0; i < LifeBar.Length; i++)
            {
                CurrentLife[i]       = new StaticSprite(Game, "FullHeart", Vector2.Zero, inventoryExtras, Game.spriteBatch);
                CurrentLife[i].Layer = 0.93f;
            }

            Rupees           = new StaticSprite[2];
            Rupees[0]        = new StaticSprite(Game, "0", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            Rupees[0].Layer  = 0.93f;
            Rupees[1]        = new StaticSprite(Game, "0", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            Rupees[1].Colour = Color.Black;
            Rupees[1].Layer  = 0.93f;

            Keys           = new StaticSprite[2];
            Keys[0]        = new StaticSprite(Game, "0", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            Keys[0].Layer  = 0.93f;
            Keys[1]        = new StaticSprite(Game, "0", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            Keys[1].Colour = Color.Black;
            Keys[1].Layer  = 0.93f;

            Bombs           = new StaticSprite[2];
            Bombs[0]        = new StaticSprite(Game, "0", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            Bombs[0].Layer  = 0.93f;
            Bombs[1]        = new StaticSprite(Game, "0", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            Bombs[1].Colour = Color.Black;
            Bombs[1].Layer  = 0.93f;

            LevelNumber       = new StaticSprite(Game, "1", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            LevelNumber.Layer = 0.93f;

            LinkLocationIndicator       = new StaticSprite(Game, "LinkLocationMap", Vector2.Zero, inventoryExtras, Game.spriteBatch);
            LinkLocationIndicator.Layer = 0.94f;

            //this is actually room 17 in accordance with group numbering standard, all others as are they say
            MapRooms[0] = new StaticSprite(Game, "MapRoomTypeC", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[0] = new Vector2(152, 112);

            MapRooms[1] = new StaticSprite(Game, "MapRoomTypeI", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[1] = new Vector2(144, 152);

            MapRooms[2] = new StaticSprite(Game, "MapRoomTypeE", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[2] = new Vector2(152, 152);


            MapRooms[3] = new StaticSprite(Game, "MapRoomTypeA", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[3] = new Vector2(160, 152);


            MapRooms[4] = new StaticSprite(Game, "MapRoomTypeN", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[4] = new Vector2(152, 144);


            MapRooms[5] = new StaticSprite(Game, "MapRoomTypeJ", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[5] = new Vector2(144, 136);


            MapRooms[6] = new StaticSprite(Game, "MapRoomTypeH", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[6] = new Vector2(152, 136);


            MapRooms[7] = new StaticSprite(Game, "MapRoomTypeD", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[7] = new Vector2(160, 136);


            MapRooms[8] = new StaticSprite(Game, "MapRoomTypeI", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[8] = new Vector2(136, 128);


            MapRooms[9] = new StaticSprite(Game, "MapRoomTypeF", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[9] = new Vector2(144, 128);


            MapRooms[10] = new StaticSprite(Game, "MapRoomTypeH", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[10] = new Vector2(152, 128);


            MapRooms[11] = new StaticSprite(Game, "MapRoomTypeF", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[11] = new Vector2(160, 128);


            MapRooms[12] = new StaticSprite(Game, "MapRoomTypeD", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[12] = new Vector2(168, 128);


            MapRooms[13] = new StaticSprite(Game, "MapRoomTypeN", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[13] = new Vector2(152, 120);


            MapRooms[14] = new StaticSprite(Game, "MapRoomTypeK", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[14] = new Vector2(168, 120);


            MapRooms[15] = new StaticSprite(Game, "MapRoomTypeA", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[15] = new Vector2(176, 120);


            MapRooms[16] = new StaticSprite(Game, "MapRoomTypeI", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1
            };
            MapRoomPositions[16] = new Vector2(144, 112);


            MapRooms[17] = new StaticSprite(Game, "MapRoomTypeC", Vector2.Zero, inventoryExtras, Game.spriteBatch)
            {
                Colour      = Color.White,
                Layer       = 0.93f,
                TotalFrames = 1,
            };
            MapRoomPositions[17] = new Vector2(152, 112);
        }
Exemplo n.º 16
0
 private void CreateSprite()
 {
     Sprite       = new StaticSprite(Game, "LockedDoor" + Side, Position, Game.TileSpriteSheet, Game.spriteBatch);
     Sprite.Layer = 0.5f;
 }
Exemplo n.º 17
0
        private void SetupHUDSprites()
        {
            MainHUD       = new StaticSprite(Game, "HUD", Vector2.Zero, hud, Game.spriteBatch);
            MainHUD.Layer = 0.95f;

            miniMap        = new StaticSprite(Game, "Dungeon01Map", Vector2.Zero, hudExtras, Game.spriteBatch);
            miniMap.Layer  = 1f;
            miniMap.Colour = Color.White;

            WeaponA             = new StaticSprite(Game, "SwordSwing", Vector2.Zero, Game.EffectSpriteSheet, Game.spriteBatch);
            WeaponA.Layer       = 1f;
            WeaponA.TotalFrames = 1;

            LifeBar = new StaticSprite[16];
            for (int i = 0; i < LifeBar.Length; i++)
            {
                LifeBar[i]       = new StaticSprite(Game, "EmptyHeart", Vector2.Zero, hudExtras, Game.spriteBatch);
                LifeBar[i].Layer = 0.98f;
                if (i > 2)
                {
                    LifeBar[i].Colour = Color.Black;
                }
            }

            CurrentLife = new StaticSprite[16];
            for (int i = 0; i < LifeBar.Length; i++)
            {
                CurrentLife[i]       = new StaticSprite(Game, "FullHeart", Vector2.Zero, hudExtras, Game.spriteBatch);
                CurrentLife[i].Layer = 1f;
            }

            Rupees           = new StaticSprite[2];
            Rupees[0]        = new StaticSprite(Game, "0", Vector2.Zero, hudExtras, Game.spriteBatch);
            Rupees[0].Layer  = 1f;
            Rupees[1]        = new StaticSprite(Game, "0", Vector2.Zero, hudExtras, Game.spriteBatch);
            Rupees[1].Colour = Color.Black;
            Rupees[1].Layer  = 1f;

            Keys           = new StaticSprite[2];
            Keys[0]        = new StaticSprite(Game, "0", Vector2.Zero, hudExtras, Game.spriteBatch);
            Keys[0].Layer  = 1f;
            Keys[1]        = new StaticSprite(Game, "0", Vector2.Zero, hudExtras, Game.spriteBatch);
            Keys[1].Colour = Color.Black;
            Keys[1].Layer  = 1f;

            Bombs           = new StaticSprite[2];
            Bombs[0]        = new StaticSprite(Game, "0", Vector2.Zero, hudExtras, Game.spriteBatch);
            Bombs[0].Layer  = 1f;
            Bombs[1]        = new StaticSprite(Game, "0", Vector2.Zero, hudExtras, Game.spriteBatch);
            Bombs[1].Colour = Color.Black;
            Bombs[1].Layer  = 1f;

            LevelNumber       = new StaticSprite(Game, "1", Vector2.Zero, hudExtras, Game.spriteBatch);
            LevelNumber.Layer = 1f;

            LinkLocationIndicator       = new StaticSprite(Game, "LinkLocationMiniMap", Vector2.Zero, hudExtras, Game.spriteBatch);
            LinkLocationIndicator.Layer = 1f;

            miniMapRoomPositions[0]  = new Vector2(18, 108);
            miniMapRoomPositions[1]  = new Vector2(26, 108);
            miniMapRoomPositions[2]  = new Vector2(34, 108);
            miniMapRoomPositions[3]  = new Vector2(26, 104);
            miniMapRoomPositions[4]  = new Vector2(18, 100);
            miniMapRoomPositions[5]  = new Vector2(26, 100);
            miniMapRoomPositions[6]  = new Vector2(34, 100);
            miniMapRoomPositions[7]  = new Vector2(10, 96);
            miniMapRoomPositions[8]  = new Vector2(18, 96);
            miniMapRoomPositions[9]  = new Vector2(26, 96);
            miniMapRoomPositions[10] = new Vector2(34, 96);
            miniMapRoomPositions[11] = new Vector2(42, 96);
            miniMapRoomPositions[12] = new Vector2(26, 92);
            miniMapRoomPositions[13] = new Vector2(42, 92);
            miniMapRoomPositions[14] = new Vector2(50, 92);
            miniMapRoomPositions[15] = new Vector2(18, 88);
            miniMapRoomPositions[16] = new Vector2(26, 88);
        }