Пример #1
0
        // *********************************************************************

        public Witch(int stepX, int stepY)
        {
            Width             = 2 * All.TileWidth;
            Height            = 21;
            toLeft            = new OneSprite(20 * 100, 16, 21, 18, 100, true);
            toRight           = new OneSprite(24 * 100, 16, 21, 18, 100, true);
            spriteMakePotion  = new OneSprite(32 * 100, 16, 21, 3, 80, true);
            spriteDying       = new OneSprite(38 * 100, 16, 21, 8, 80, true);
            spriteExitingDoor = new OneSprite(28 * 100 + 14, 16, 21, 3, 140, true);
            spriteEnterDoor   = new OneSprite(28 * 100, 16, 21, 4, 140, true);
            currentStep       = 0;
            toRight.SetAnimSteps(currentStep, currentStep, 0);
            ChangeToState(WitchState.RightWalk);
            moving     = false;
            this.stepX = stepX;
            this.stepY = stepY;
            rightX     = 12 * 2;
        }
Пример #2
0
 public Typo()
 {
     characters = new OneSprite(36 * 100, 8, 8, 37, 0, withSeparator: false);
 }
Пример #3
0
        // *********************************************************************

        public Monsters(int stepX, int stepY)
        {
            monsters             = new List <OneMonster>();
            inhibeGeneratorID    = new Dictionary <int, int>();
            generatorInhibeDelay = All.TileWidth; // tileWidthScale * 2;
            this.stepX           = stepX;
            this.stepY           = stepY * 2;

            spriteExplode = new OneSprite(15 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, 8, 1000);

            for (int i = 0; i < BAT_SPRITES_MAX; i++)
            {
                spritesBat1[i]          = new OneSprite(7 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, BAT_SPRITES_MAX, 120, animBack: true);
                spritesBat1[i].StepAnim = i % BAT_SPRITES_MAX;
                spritesBat2[i]          = new OneSprite(7 * 100 + 100 - 16, SPRITE_WIDTH, SPRITE_HEIGHT, BAT_SPRITES_MAX, 120, animBack: true);
                spritesBat2[i].StepAnim = i % BAT_SPRITES_MAX;
            }
            for (int i = 0; i < GHOST_SPRITES_MAX; i++)
            {
                spritesGhost[i]          = new OneSprite(11 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, GHOST_SPRITES_MAX, 120);
                spritesGhost[i].StepAnim = i % GHOST_SPRITES_MAX;
            }
            spriteShark = new OneSprite(20 * 100 + 100 - 16, SPRITE_WIDTH, SPRITE_HEIGHT, 1, 0);
            for (int i = 0; i < SEAGULL_SPRITES_MAX; i++)
            {
                spritesSeagull[i]          = new OneSprite(20 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, SEAGULL_SPRITES_MAX, 120);
                spritesSeagull[i].StepAnim = i % SEAGULL_SPRITES_MAX;
            }
            for (int i = 0; i < SKULL_SPRITES_MAX; i++)
            {
                spritesSkull[i]          = new OneSprite(20 * 100 + 100 - 12, SPRITE_WIDTH, SPRITE_HEIGHT, SKULL_SPRITES_MAX, 120, animBack: true);
                spritesSkull[i].StepAnim = i % SKULL_SPRITES_MAX;
            }
            for (int i = 0; i < BONES_SPRITES_MAX; i++)
            {
                spritesBones[i]          = new OneSprite(24 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, BONES_SPRITES_MAX, 120, animBack: true);
                spritesBones[i].StepAnim = i % 3;
            }
            for (int i = 0; i < FIREBALL_SPRITES_MAX; i++)
            {
                spritesFireball[i]          = new OneSprite(28 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, FIREBALL_SPRITES_MAX, 120);
                spritesFireball[i].StepAnim = i % FIREBALL_SPRITES_MAX;
            }
            for (int i = 0; i < RIBCAGE_SPRITES_MAX; i++)
            {
                spritesRibcage[i]          = new OneSprite(36 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, RIBCAGE_SPRITES_MAX, 120, animBack: true);
                spritesRibcage[i].StepAnim = i % RIBCAGE_SPRITES_MAX;
            }
            for (int i = 0; i < SNAPPER_SPRITES_MAX; i++)
            {
                spritesSnapper[i]          = new OneSprite(40 * 100 + 100 - 32, SPRITE_WIDTH, SPRITE_HEIGHT, SNAPPER_SPRITES_MAX, 120);
                spritesSnapper[i].StepAnim = i % SNAPPER_SPRITES_MAX;
            }
            for (int i = 0; i < MANDRAGORA_SPRITES_MAX; i++)
            {
                spritesMandragora[i]          = new OneSprite(32 * 100 + 100 - 36, SPRITE_WIDTH, SPRITE_HEIGHT, MANDRAGORA_SPRITES_MAX, 120, animBack: true);
                spritesMandragora[i].StepAnim = i % MANDRAGORA_SPRITES_MAX;
            }
            for (int i = 0; i < PUMPKIN_SPRITES_MAX; i++)
            {
                spritesPumpkin[i]          = new OneSprite(36 * 100 + 100 - 32 - 24, SPRITE_WIDTH, SPRITE_HEIGHT, PUMPKIN_SPRITES_MAX, 120);
                spritesPumpkin[i].StepAnim = i % PUMPKIN_SPRITES_MAX;
            }
            for (int i = 0; i < PUMPKING_SPRITES_MAX; i++)
            {
                spritesPumpKing[i]          = new OneSprite(24 * 100 + 100 - 20, SPRITE_WIDTH, SPRITE_HEIGHT, PUMPKING_SPRITES_MAX, 120, animBack: true);
                spritesPumpKing[i].StepAnim = i % PUMPKING_SPRITES_MAX;
            }

            // un pattern est constitué d'une suite de couple "mouvement/combien de case(0=infini)"
            // Chauve souris type 1
            float[] pattern = { (short)MovingDirection.DiagUpLeft, 2.3f, (short)MovingDirection.DiagDownLeft, 2.3f, (short)MovingDirection.ToLeft, 0 };
            patternBat1.Add(pattern);
            pattern = new float[] { (short)MovingDirection.DiagUpLeft, 2.3f, (short)MovingDirection.DiagDownLeft, 2.3f, (short)MovingDirection.ToRight, 0 };
            patternBat1.Add(pattern);
            pattern = new float[] { (short)MovingDirection.DiagUpRight, 1.1f, (short)MovingDirection.DiagDownRight, 1.1f, (short)MovingDirection.ToLeft, 0 };
            patternBat1.Add(pattern);
            pattern = new float[] { (short)MovingDirection.DiagUpRight, 1.1f, (short)MovingDirection.DiagDownRight, 1.1f, (short)MovingDirection.ToRight, 0 };
            patternBat1.Add(pattern);

            // Chauve souris type 2
            pattern = new float[] { (short)MovingDirection.ToTop, 0, (short)MovingDirection.ToLeft, 2.3f, (short)MovingDirection.ToDown, 1.6f, (short)MovingDirection.ToRight, 1.9f, (short)MovingDirection.ToUp, 1.3f, (short)MovingDirection.ToWitch, 0 };
            patternBat2.Add(pattern);
            pattern = new float[] { (short)MovingDirection.ToTop, 0, (short)MovingDirection.ToRight, 2.3f, (short)MovingDirection.ToDown, 1.6f, (short)MovingDirection.ToLeft, 1.9f, (short)MovingDirection.ToUp, 1.3f, (short)MovingDirection.ToWitch, 0 };
            patternBat2.Add(pattern);

            // Fantôme
            pattern = new float[] { (short)MovingDirection.ToUpSpeed, 2.0f, (short)MovingDirection.DiagUpLeft, 0.7f, (short)MovingDirection.DiagUpRight, 0.7f, (short)MovingDirection.ToWitch, 0 };
            patternGhost.Add(pattern);
            pattern = new float[] { (short)MovingDirection.ToUpSpeed, 2.0f, (short)MovingDirection.DiagUpRight, 0.7f, (short)MovingDirection.DiagUpLeft, 0.7f, (short)MovingDirection.ToWitch, 0 };
            patternGhost.Add(pattern);
            pattern = new float[] { (short)MovingDirection.ToUp, 3.0f, (short)MovingDirection.DiagUpLeft, 1.0f, (short)MovingDirection.DiagDownRightSpeed, 0.8f, (short)MovingDirection.ToLeft, 2.0f, (short)MovingDirection.ToDownSpeed, 1.8f };
            patternGhost.Add(pattern);


            // Requin
            pattern = new float[] { (short)MovingDirection.DiagUpLeftSlow, 0.2f, (short)MovingDirection.ToLeft, 7.0f, (short)MovingDirection.DiagDownLeftSlow, 2.0f };
            patternShark.Add(pattern);

            pattern = new float[] { (short)MovingDirection.None, 0 };
            patternStatic.Add(pattern);

            lastPatternAnim = DateTime.UtcNow;
        }