Esempio n. 1
0
        public void SwitchCharacter(CharacterMetamorphose newCharacter)
        {
            switch (newCharacter)
            {
            case CharacterMetamorphose.HUMAN:
                human.CurrentPosition       = CurrentPlayerCharacter.CurrentPosition;
                human.CharacterFaces        = CurrentPlayerCharacter.CharacterFaces;
                this.CurrentPlayerCharacter = human;
                break;

            case CharacterMetamorphose.HULK:
                hulk.CurrentPosition        = CurrentPlayerCharacter.CurrentPosition;
                hulk.CharacterFaces         = CurrentPlayerCharacter.CharacterFaces;
                this.CurrentPlayerCharacter = hulk;
                break;

            case CharacterMetamorphose.FOETUS:
                foetus.CurrentPosition      = CurrentPlayerCharacter.CurrentPosition;
                foetus.CharacterFaces       = CurrentPlayerCharacter.CharacterFaces;
                this.CurrentPlayerCharacter = foetus;
                break;

            case CharacterMetamorphose.SPIRIT:
                spirit.CurrentPosition      = CurrentPlayerCharacter.CurrentPosition;
                spirit.CharacterFaces       = CurrentPlayerCharacter.CharacterFaces;
                this.CurrentPlayerCharacter = spirit;
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        public Character CreateCharacter(CharacterMetamorphose characterState)
        {
            //attention à la présence ou non des animations
            switch (characterState)
            {
            case CharacterMetamorphose.HUMAN:
                return(new Character(CharacterMetamorphose.HUMAN, new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HUMAN_IDLE"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HUMAN_RUN"), Vector2.Zero, 12, framespeed: 3),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HUMAN_JUMP"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HUMAN_JUMP"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("human_idle"), Vector2.Zero, 1)));

            case CharacterMetamorphose.HULK:
                return(new Character(CharacterMetamorphose.HULK, new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HULK_IDLE"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HULK_RUN"), Vector2.Zero, 4, framespeed: 4),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HULK_JUMP"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HULK_JUMP"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/HULK_IDLE"), Vector2.Zero, 1)));

            case CharacterMetamorphose.FOETUS:
                return(new Character(CharacterMetamorphose.FOETUS, new AnimatedSprite(mG.Content.Load <Texture2D>("animation/FOETUS_IDLE"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/FOETUS_RUN"), Vector2.Zero, 12, framespeed: 4),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/FOETUS_IDLE"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/FOETUS_IDLE"), Vector2.Zero, 1),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/FOETUS_IDLE"), Vector2.Zero, 1)));

            case CharacterMetamorphose.SPIRIT:
                return(new Character(CharacterMetamorphose.SPIRIT, new AnimatedSprite(mG.Content.Load <Texture2D>("animation/SPIRIT_IDLE"), Vector2.Zero, 4),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/SPIRIT_IDLE"), Vector2.Zero, 4),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/SPIRIT_IDLE"), Vector2.Zero, 4),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/SPIRIT_IDLE"), Vector2.Zero, 4),
                                     new AnimatedSprite(mG.Content.Load <Texture2D>("animation/SPIRIT_IDLE"), Vector2.Zero, 4)));

            default:
                return(null);
            }
        }
Esempio n. 3
0
 public TileTransform(Vector2 currentPosition, int width, int height, CharacterMetamorphose typeMetamorphose) : base(currentPosition, width, height)
 {
     CurrentPosition       = currentPosition;
     traversable           = true;
     this.typeMetamorphose = typeMetamorphose;
 }