Exemple #1
0
void StrongCharacter::Step(double time)
{
    animation_->Step(time);

    if (!grab_ && !(state_ & kAction)) {
        DoWalk(time);
    } else {
        double dir = direction_ == kLeft ? -1 : 1; 
        if (state_ & kMoveLeft) {
            launch_angle_ += dir * time / 2 * 90;
        } else if (state_ & kMoveRight) {
            launch_angle_ -= dir * time / 2 * 90;
        }

        if (launch_angle_ < 0) {
            launch_angle_ = 0;
        } else if (launch_angle_ > 80) {
            launch_angle_ = 80;
        }
    }

    if (state_ & kAction) {
        animation_->SetState("grab");
    } else if (IsGrounded() && !(state_ & (kMoveLeft | kMoveRight))) {
        animation_->SetState("stand");
    }

}
Exemple #2
0
void BipedManager::TransitionRunWalkToWalk()
{
    mState = ANIM_WALK;
    DoWalk();
}