Exemple #1
0
        //////////////////////////////////////
        //////////  INITIALISATION  //////////
        //////////////////////////////////////

        protected override void Initialize()
        {
            _crossedSwordsButton = new CrossedSwordsButton(Content);

            Characters.Add(_soldierSprite);
            Characters.Add(_elfSprite);
            Characters.Add(_paladinSprite);
            Characters.Add(_dwarfSprite);

            foreach (var t in Characters)
            {
                t.Initialize(this, _graphics);
            }

            AnimationTemp = new AnimationSprite(this, new AnimationDefinition(), 0)
            {
                Direction = new Vector2(0, 0),
                Position  = new Vector2(10, 10)
            };

            base.Initialize();
        }
Exemple #2
0
 // Passage au prochain personnage
 public void NextCharacter(MoveTilesSprite moveTileSprite, FightTilesSprite fightTilesSprite, CrossedSwordsButton crossedSwordsButton,
                           bool crossedSwordsButtonClicked)
 {
     crossedSwordsButton.ResetList();
     crossedSwordsButton.CharactersTargetable(false);
     if (Game1.Characters[Game1.Count].FacingRight)
     {
         Game1.Characters[Game1.Count].AnimationIdleRightSprite.Position = new Vector2(Game1.Characters[Game1.Count].AnimationSprite.Position.X -
                                                                                       (Game1.Characters[Game1.Count].AnimationIdleRightSprite.Definition.FrameSize.X - Game1.Characters[Game1.Count].AnimationSprite.Definition.FrameSize.X) / 2,
                                                                                       Game1.Characters[Game1.Count].AnimationSprite.Position.Y);
         Game1.Characters[Game1.Count].AnimationSprite = Game1.Characters[Game1.Count].AnimationIdleRightSprite;
     }
     else
     {
         Game1.Characters[Game1.Count].AnimationIdleLeftSprite.Position = new Vector2(Game1.Characters[Game1.Count].AnimationSprite.Position.X -
                                                                                      (Game1.Characters[Game1.Count].AnimationIdleLeftSprite.Definition.FrameSize.X - Game1.Characters[Game1.Count].AnimationSprite.Definition.FrameSize.X) / 2,
                                                                                      Game1.Characters[Game1.Count].AnimationSprite.Position.Y);
         Game1.Characters[Game1.Count].AnimationSprite = Game1.Characters[Game1.Count].AnimationIdleLeftSprite;
     }
     Game1.Count++;
     if (Game1.Count == Game1.Characters.Count)
     {
         Game1.Count = 0;
     }
     Game1.Characters[Game1.Count].AnimationSprite = Game1.Characters[Game1.Count].CharacterSelectedSprite(Game1.Characters,
                                                                                                           Game1.Count);
     Game1.CharacterHasMoved   = false;
     Game1.CharacterHasStriked = false;
     if (crossedSwordsButtonClicked)
     {
         crossedSwordsButton.CharactersTargetable(true);
     }
     moveTileSprite.ResetMap();
     fightTilesSprite.ResetMap();
 }