public AnimationSequence(Animation animation, AnimationPurposeEnum purpose, HorizontalDirectionEnum facing) { _animation = animation; _purpose = purpose; _facing = facing; _destPoint = new PointF(0f, 0f); _triggerAnimationSeqs = new ArrayList(); _waitToTrigger = false; _isStarted = false; _isEnd = false; _triggerWhenBegin = false; _triggerWhenEnd = false; }
public StandardCharacter() { _moveSpeed = 5; _moveSpeedX = _moveSpeed; // animation move speed _moveSpeedY = _moveSpeed; // animation move speed\ _currentFacingDirection = HorizontalDirectionEnum.Right; _command = new Idle(); _animations = new Heroes.Core.Battle.Characters.Armies.ArmyAnimations(); _isBeginTurn = false; _isEndTurn = false; _isDead = false; _currentAnimationSeq = null; }
public void Initalize() { if (_armySide == ArmySideEnum.Attacker) { _currentFacingDirection = HorizontalDirectionEnum.Right; _currentAnimationPt = new Point(0, 0); } else { _currentFacingDirection = HorizontalDirectionEnum.Left; _currentAnimationPt = new Point(800 - _rect.Width, 0); _rect.X = (int)_currentAnimationPt.X; } Action action = CreateStandingAction(this, _currentFacingDirection); SetAnimation(action._currentAnimationSeq); }
public Action CreateStandingAction(Hero character, HorizontalDirectionEnum facing) { Action action = new Action(ActionTypeEnum.Standing); Animation animation = null; if (facing == HorizontalDirectionEnum.Right) { if (this._sex == SexEnum.Male) animation = this._animations._standingRightMale; else animation = this._animations._standingRightFemale; } else { if (this._sex == SexEnum.Male) animation = this._animations._standingLeftMale; else animation = this._animations._standingLeftFemale; } AnimationSequence seq = new AnimationSequence(animation, AnimationPurposeEnum.StandingStill, facing); action._animationSeqs.Add(seq); action._currentAnimationSeq = seq; return action; }
public void SetAnimation(AnimationPurposeEnum purpose, HorizontalDirectionEnum facing) { if (purpose == AnimationPurposeEnum.StandingStill) { if (facing == HorizontalDirectionEnum.Right) { Animation animation = null; if (this._isBeginTurn) animation = this._animations._standingRightActive; else animation = this._animations._standingRight; if (this._currentAnimation != animation) { this._currentAnimation = animation; this._currentAnimationRunner = this._currentAnimation.CreateRunner(); } } else if (facing == HorizontalDirectionEnum.Left) { Animation animation = null; if (this._isBeginTurn) animation = this._animations._standingLeftActive; else animation = this._animations._standingLeft; if (this._currentAnimation != animation) { this._currentAnimation = animation; this._currentAnimationRunner = this._currentAnimation.CreateRunner(); } } } else if (purpose == AnimationPurposeEnum.Moving) { if (facing == HorizontalDirectionEnum.Right) { if (this._currentAnimation != this._animations._movingRight) { this._currentAnimation = this._animations._movingRight; this._currentAnimationRunner = this._currentAnimation.CreateRunner(); } } else if (facing == HorizontalDirectionEnum.Left) { if (this._currentAnimation != this._animations._movingLeft) { this._currentAnimation = this._animations._movingLeft; this._currentAnimationRunner = this._currentAnimation.CreateRunner(); } } } else if (purpose == AnimationPurposeEnum.Hover) { if (facing == HorizontalDirectionEnum.Right) { if (this._currentAnimation != this._animations._standingRightHover) { this._currentAnimation = this._animations._standingRightHover; this._currentAnimationRunner = this._currentAnimation.CreateRunner(); } } else if (facing == HorizontalDirectionEnum.Left) { if (this._currentAnimation != this._animations._standingLeftHover) { this._currentAnimation = this._animations._standingLeftHover; this._currentAnimationRunner = this._currentAnimation.CreateRunner(); } } } }
public Action CreateStandingAction(StandardCharacter character, HorizontalDirectionEnum facing, bool isActive) { // no standing for dead character if (character._isDead) return null; Action action = new Action(ActionTypeEnum.Standing); Animation animation = null; if (facing == HorizontalDirectionEnum.Right) { if (isActive) animation = _animations._standingRightActive; else animation = _animations._standingRight; } else { if (isActive) animation = _animations._standingLeftActive; else animation = _animations._standingLeft; } if (animation == null) { Debug.WriteLine(""); } AnimationSequence seq = new AnimationSequence(animation, AnimationPurposeEnum.StandingStill, facing); action._animationSeqs.Add(seq); action._currentAnimationSeq = seq; return action; }
public Action CreateGettingHitAction(HorizontalDirectionEnum facing) { Action action = new Action(ActionTypeEnum.GettingHit); Animation animation = null; if (facing == HorizontalDirectionEnum.Right) { animation = _animations._gettingHitRight; } else { animation = _animations._gettingHitLeft; } AnimationSequence seq = new AnimationSequence(animation, AnimationPurposeEnum.GettingHit, facing); action._animationSeqs.Add(seq); action._currentAnimationSeq = seq; return action; }
public Action CreateFirstStandingAction(StandardCharacter character, HorizontalDirectionEnum facing) { Action action = new Action(ActionTypeEnum.Standing); Animation animation = null; if (facing == HorizontalDirectionEnum.Right) { animation = _animations._firstStandingRight; } else { animation = _animations._firstStandingLeft; } AnimationSequence seq = new AnimationSequence(animation, AnimationPurposeEnum.StandingStill, facing); action._animationSeqs.Add(seq); action._currentAnimationSeq = seq; return action; }