Exemple #1
0
        internal static void OnNewCharacterClick(UICharacterSelect state, UIMouseEvent evt, UIElement listeningElement)
        {
            state.RealNewCharacterClick(evt, listeningElement);

            var bh = AttachBHandler(Main.PendingPlayer);

            if (bh != null)
            {
                bh.OnCreated();
            }
        }
Exemple #2
0
        /// <summary>
        /// Move the character across the screen and change animations accordingly
        /// </summary>
        /// <param name="translationVector"></param>
        public override void Translate(Vector2 translationVector)
        {
            // Remove two action points for moving
            base.Translate(translationVector);
            UICharacterSelect.Translate(translationVector);

            if (lastTranslation != translationVector)
            {
                lastTranslation = translationVector;

                if (translationVector.X != 0)
                {
                    bool vectorCheck = translationVector.X > 0;
                    animationSprite.SetAnimation(vectorCheck ? WALK_ANIMATION_RIGHT_INDEX : WALK_ANIMATION_LEFT_INDEX);
                    currentAnimationState = vectorCheck ? AnimationState.WALK_RIGHT : AnimationState.WALK_LEFT;
                }
                else if (translationVector.Y != 0)
                {
                    bool vectorCheck = translationVector.Y > 0;
                    animationSprite.SetAnimation(vectorCheck ? WALK_ANIMATION_DOWN_INDEX : WALK_ANIMATION_UP_INDEX);
                    currentAnimationState = vectorCheck ? AnimationState.WALK_DOWN : AnimationState.WALK_UP;
                }
            }
        }
Exemple #3
0
 // fsm interface
 public void ShowClassList()
 {
     uiCharacterSelect = panel2.AddUI("Common/CharacterSelect", fsm) as UICharacterSelect;
     uiCharacterSelect.Init(SaveData.selectClass);
 }