Пример #1
0
        public Dodongo(Texture2D texture, Vector2 location, Game1 game) : base(texture, location, game)
        {
            bombsEaten       = 0;
            width            = 32;
            health           = 50;
            scaledSideLength = (int)(sideLength * Game1.Scale);
            scaledWidth      = (int)(width * Game1.Scale);

            direction = Direction.West;
            Location  = new Rectangle((int)location.X, (int)location.Y, scaledWidth, scaledSideLength);
            Texture   = texture;

            totalFramesUD  = 4; currentFrameUD = 0;
            totalFramesRL  = 3; currentFrameRL = 0;
            repeatedFrames = 10;
            damage         = 2;

            xOffsetRL        = xOffsetUD + totalFramesUD * (1 + sideLength);
            upDownSources    = SpritesheetHelper.GetFramesH(xOffsetUD, yOffset, sideLength, sideLength, totalFramesUD);
            rightLeftSources = SpritesheetHelper.GetFramesH(xOffsetRL, yOffset, width, sideLength, totalFramesRL);


            currentSpriteEffect = 0;
            spriteEffects       = new List <SpriteEffects> {
                SpriteEffects.None,
                SpriteEffects.FlipHorizontally
            };

            eatingCounter = 0;
            eatingTime    = 20;
        }
Пример #2
0
 public GanonFireball(Texture2D texture, Vector2 location, Direction dir, IEntity shooter)
 {
     Shooter         = shooter;
     Texture         = texture;
     this.dir        = dir;
     Location        = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
     currFrame       = 0;
     totalFrames     = 4;
     repeatedFrames  = 2;
     dirToSourcesMap = new Dictionary <Direction, List <Rectangle> >
     {
         { Direction.North, SpritesheetHelper.GetFramesH(276, 157, width, height, totalFrames) },
         { Direction.NorthWest, SpritesheetHelper.GetFramesH(276, 174, width, height, totalFrames) },
         { Direction.West, SpritesheetHelper.GetFramesH(276, 192, width, height, totalFrames) },
         { Direction.SouthWest, SpritesheetHelper.GetFramesH(276, 174, width, height, totalFrames) },
         { Direction.South, SpritesheetHelper.GetFramesH(276, 157, width, height, totalFrames) },
         { Direction.SouthEast, SpritesheetHelper.GetFramesH(276, 174, width, height, totalFrames) },
         { Direction.East, SpritesheetHelper.GetFramesH(276, 192, width, height, totalFrames) },
         { Direction.NorthEast, SpritesheetHelper.GetFramesH(276, 174, width, height, totalFrames) }
     };
     dirToEffectsMap = new Dictionary <Direction, SpriteEffects>
     {
         { Direction.North, SpriteEffects.None },
         { Direction.NorthWest, SpriteEffects.None },
         { Direction.West, SpriteEffects.None },
         { Direction.SouthWest, SpriteEffects.FlipVertically },
         { Direction.South, SpriteEffects.FlipVertically },
         { Direction.SouthEast, SpriteEffects.FlipVertically | SpriteEffects.FlipHorizontally },
         { Direction.East, SpriteEffects.FlipHorizontally },
         { Direction.NorthEast, SpriteEffects.FlipHorizontally }
     };
     hit = false;
 }
Пример #3
0
 public GanonAshes(Texture2D texture, Vector2 location)
 {
     Texture  = texture;
     Location = new Rectangle((int)location.X, (int)location.Y, (int)(size * Game1.Scale), (int)(size * Game1.Scale));
     sources  = SpritesheetHelper.GetFramesV(xOffset, yOffset, size, size, totalFrames);
     frame    = 0;
 }
Пример #4
0
        public Wallmaster(Texture2D texture, Vector2 location, Game1 game) : base(texture, location, game)
        {
            width          = 16;
            height         = 16;
            health         = 8;
            Location       = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture        = texture;
            sources        = SpritesheetHelper.GetFramesH(xOffset, yOffset, width, height, 2);
            totalFrames    = 2;
            repeatedFrames = 8;
            damage         = 1;

            if (Location.X <= Game1.Width / 2)
            {
                s = SpriteEffects.None;
            }
            else
            {
                s = SpriteEffects.FlipHorizontally;
            }
            if (Location.Y < Game1.MapHeight / 2 + Game1.HUDHeight)
            {
                s |= SpriteEffects.FlipVertically;
            }
            ChangeDirection();
        }
Пример #5
0
 private void SetSources()
 {
     Location     = new Rectangle(0, 0, (int)(Game1.Width * Game1.Scale), (int)((Game1.MapHeight + Game1.HUDHeight) * Game1.Scale));
     source       = new Rectangle(xoffset, yoffset, 256, 224);
     sourceSplash = SpritesheetHelper.GetFramesH(846, 11, waterEffectWidth, waterEffectHeight, splashFrames);
     sourceWaves  = SpritesheetHelper.GetFramesH(776, 28, waterEffectWidth, waterEffectHeight, waveFrames);
 }
Пример #6
0
 public HUDMiniMapping()
 {
     source = SpritesheetHelper.GetFramesH(xOffset, yOffset, sideLength, sideLength, totalFrames);
     source.Add(new Rectangle(528, 126, sideLength, sideLength));
     levelSources = SpritesheetHelper.GetFramesH(537, 117, sideLength, sideLength, 4);
     roomPos      = new Dictionary <int, Rectangle>();
     rowMapping0  = new Dictionary <int, int>
     {
         { 0, (int)RoomPosition.Bottom },
     };
     rowMapping1 = new Dictionary <int, int>
     {
         { 18, (int)RoomPosition.Top },
         { 1, (int)RoomPosition.Top },
         { 2, (int)RoomPosition.Both },
         { 19, (int)RoomPosition.Top },
         { 20, (int)RoomPosition.Both },
         { 21, (int)RoomPosition.Both },
     };
     rowMapping2 = new Dictionary <int, int>
     {
         { 4, (int)RoomPosition.Top },
         { 5, (int)RoomPosition.Both },
         { 6, (int)RoomPosition.Both },
         { 7, (int)RoomPosition.Both },
         { 10, (int)RoomPosition.Top },
     };
     rowMapping3 = new Dictionary <int, int>
     {
         { 15, (int)RoomPosition.Bottom },
         { 14, (int)RoomPosition.Both },
         { 17, (int)RoomPosition.Bottom },
     };
     overlap = new Dictionary <int, int>
     {
         { 0, 0 },
         { 3, 2 },
         { 8, 20 },
         { 9, 21 },
         { 11, 5 },
         { 12, 6 },
         { 13, 7 },
         { 16, 14 },
         { 15, 15 },
         { 17, 17 },
     };
     fullMapping = new List <Dictionary <int, int> >
     {
         rowMapping0,
         rowMapping1,
         rowMapping2,
         rowMapping3,
     };
     AddMapping();
 }
Пример #7
0
 public FairyEnemy(Texture2D texture, Vector2 location, Game1 game) : base(texture, location, game)
 {
     width          = 7;
     height         = 16;
     dirChangeDelay = 20;
     health         = 16;
     Location       = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
     Texture        = texture;
     totalFrames    = 2;
     currentFrame   = 0;
     repeatedFrames = 10;
     direction      = Direction.North;
     damage         = 1;
     sprites        = SpritesheetHelper.GetFramesH(xPos, yPos, width, height, totalFrames);
 }
Пример #8
0
        public OldPerson(Texture2D texture, Vector2 location, NPCEnum type)
        {
            width    = height = 16;
            Location = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture  = texture;
            Type     = type;
            List <Rectangle> sources = SpritesheetHelper.GetFramesH(xOffset, yOffset, width, height, 3);

            typeRectMap = new Dictionary <NPCEnum, Rectangle>
            {
                { NPCEnum.OldMan1, sources[0] },
                { NPCEnum.OldMan2, sources[1] },
                { NPCEnum.OldWoman, sources[2] }
            };
        }
Пример #9
0
        public Merchant(Texture2D texture, Vector2 location, Color type)
        {
            width    = height = 16;
            Location = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture  = texture;
            Type     = type;
            List <Rectangle> sources = SpritesheetHelper.GetFramesH(xOffset, yOffset, width, height, 3);

            typeRectMap = new Dictionary <Color, Rectangle>
            {
                { Color.Green, sources[0] },
                { Color.White, sources[1] },
                { Color.Red, sources[2] }
            };
        }
Пример #10
0
        public Snake(Texture2D texture, Vector2 location, Game1 game) : base(texture, location, game)
        {
            dirChangeDelay = 25;
            health         = 16;
            width          = height = 16;
            Location       = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture        = texture;
            spriteEffect   = SpriteEffects.None;
            totalFrames    = 2;
            currentFrame   = 0;
            repeatedFrames = 10;
            int xPos = 126, yPos = 59;

            sources = SpritesheetHelper.GetFramesH(xPos, yPos, width, height, totalFrames);
            damage  = 1;
        }
Пример #11
0
        public Owl(Texture2D texture, Vector2 location, Game1 game) : base(texture, location, game)
        {
            width          = 60;
            height         = 80;
            dirChangeDelay = 20;
            health         = 16;
            Location       = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture        = texture;
            totalFrames    = 8;
            currentFrame   = 0;
            repeatedFrames = 8;
            direction      = Direction.North;
            damage         = 1;
            int offset = 35;

            sprites = SpritesheetHelper.GetFramesH(18, 10, width, height, totalFrames, offset);
        }
Пример #12
0
        public Aquamentus(Texture2D texture, Vector2 location, Game1 game) : base(texture, location, game)
        {
            health   = 15;
            width    = 24;
            height   = 32;
            Location = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture  = texture;

            currentFrame   = 0;
            totalFrames    = 4;
            repeatedFrames = 14;
            sources        = SpritesheetHelper.GetFramesH(xOffset, yOffset, width, height, totalFrames);

            direction   = Direction.East;
            moveCounter = 0;

            itemSpawner       = new ItemSpawner(game.Room.LoadLevel.RoomItems);
            fireballBehaviour = new AquamentusFireballBehaviour(game, this);
        }
Пример #13
0
        public Keese(Texture2D texture, Vector2 location, Color keeseColor, Game1 game) : base(texture, location, game)
        {
            dirChangeDelay = 5;
            width          = height = 16;
            Location       = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
            Texture        = texture;
            Color          = keeseColor;
            currentFrame   = 0;
            totalFrames    = 2;
            repeatedFrames = 8;
            direction      = Direction.North;
            damage         = 1;
            health         = 2;

            colorMap = new Dictionary <Color, List <Rectangle> >
            {
                { Color.Blue, SpritesheetHelper.GetFramesH(183, 11, width, height, totalFrames) },
                { Color.Red, SpritesheetHelper.GetFramesH(183, 28, width, height, totalFrames) }
            };
        }
Пример #14
0
 public Goriya(Texture2D texture, Vector2 location, Color goriyaColor, Game1 game) : base(texture, location, game)
 {
     health         = 6;
     width          = height = 16;
     Location       = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
     Texture        = texture;
     Color          = goriyaColor;
     currentFrame   = 0;
     totalFrames    = 4;
     repeatedFrames = 20;
     direction      = Direction.North;
     damage         = 2;
     room           = game.Room;
     throwCounter   = 0;
     colorMap       = new Dictionary <Color, List <Rectangle> >
     {
         { Color.Red, SpritesheetHelper.GetFramesH(222, 11, width, height, totalFrames) },
         { Color.Blue, SpritesheetHelper.GetFramesH(222, 28, width, height, totalFrames) }
     };
 }
Пример #15
0
 public Fireball(Texture2D texture, Vector2 location, Vector2 direction, IEntity shooter)
 {
     Shooter         = shooter;
     Texture         = texture;
     Location        = new Rectangle((int)location.X, (int)location.Y, (int)(width * Game1.Scale), (int)(height * Game1.Scale));
     preciseLocation = location;
     this.direction  = direction;
     currFrame       = 0;
     totalFrames     = 4;
     repeatedFrames  = 4;
     colorMap        = new Dictionary <string, List <Rectangle> >
     {
         { "sprint0.Ganon", SpritesheetHelper.GetFramesH(238, 157, width, height, totalFrames) },
         { "sprint0.Aquamentus", SpritesheetHelper.GetFramesH(101, 14, width, height, totalFrames) },
         { "sprint0.GleeokHead", SpritesheetHelper.GetFramesH(271, 31, width, height, totalFrames) },
         { "sprint0.Owl", SpritesheetHelper.GetFramesH(271, 31, width, height, totalFrames) },
         { "sprint0.FairyEnemy", SpritesheetHelper.GetFramesH(271, 31, width, height, totalFrames) },
         { "sprint0.Gohma", SpritesheetHelper.GetFramesH(1, 109, width, height, totalFrames) },
         { "sprint0.ManhandlaLimb", SpritesheetHelper.GetFramesH(1, 109, width, height, totalFrames) },
         { "sprint0.Statue", SpritesheetHelper.GetFramesH(231, 62, width, height, totalFrames) },
     };
 }
 public PauseScreenMapping()
 {
     sources = SpritesheetHelper.GetFramesH(xOffset, yOffset, sideLength, sideLength, totalFrames);
     sources.Add(new Rectangle(xLocation, yLocation, sideLength, sideLength));
     sources.Add(new Rectangle(xLocation + sideLength + 1, yLocation, sideLength, sideLength));
     baseY       = height + Game1.HUDHeight + (sideLength * 2);
     roomPos     = new Dictionary <int, Rectangle>();
     rowMapping0 = new Dictionary <int, int>
     {
         { 0, (int)RoomDirection.Down },
     };
     rowMapping1 = new Dictionary <int, int>
     {
         { 18, (int)RoomDirection.Right },
         { 1, (int)RoomDirection.LeftRightUp },
         { 2, (int)RoomDirection.LeftRightDown },
         { 19, (int)RoomDirection.LeftRight },
         { 20, (int)RoomDirection.LeftRight },
         { 21, (int)RoomDirection.Left },
     };
     rowMapping2 = new Dictionary <int, int>
     {
         { 3, (int)RoomDirection.UpDown },
         { 8, (int)RoomDirection.RightDown },
         { 9, (int)RoomDirection.Left },
     };
     rowMapping3 = new Dictionary <int, int>
     {
         { 4, (int)RoomDirection.Right },
         { 5, (int)RoomDirection.LeftRightDown },
         { 6, (int)RoomDirection.LeftRightUpDown },
         { 7, (int)RoomDirection.LeftRightDown },
         { 10, (int)RoomDirection.LeftUp },
     };
     rowMapping4 = new Dictionary <int, int>
     {
         { 11, (int)RoomDirection.RightUp },
         { 12, (int)RoomDirection.LeftRightUpDown },
         { 13, (int)RoomDirection.LeftUp },
     };
     rowMapping5 = new Dictionary <int, int>
     {
         { 14, (int)RoomDirection.UpDown },
     };
     rowMapping6 = new Dictionary <int, int>
     {
         { 15, (int)RoomDirection.Right },
         { 16, (int)RoomDirection.LeftRightUpDown },
         { 17, (int)RoomDirection.Left },
     };
     fullMapping = new List <Dictionary <int, int> >
     {
         rowMapping0,
         rowMapping1,
         rowMapping2,
         rowMapping3,
         rowMapping4,
         rowMapping5,
         rowMapping6,
     };
     AddMapping();
 }