Package imi.character.statemachine

Examples of imi.character.statemachine.GameState


    @Override
    public void notifyAnimationMessage(AnimationMessageType message, int stateID) {
        super.notifyAnimationMessage(message, stateID);

        GameState cur = getCurrentState();

        AvatarAnimationEvent.EventType type = null;
        String animationName = null;

        if (cur instanceof IdleState && currentAnimationName != null)
      {
            // transition out of the current state
            type = AvatarAnimationEvent.EventType.STOPPED;
            animationName = currentAnimationName;
            currentAnimationName = null;
            }
  else if (cur instanceof CycleActionState)
      {
            switch (message)
    {
                case TransitionComplete:
                    type = AvatarAnimationEvent.EventType.STARTED;
                    animationName = cur.getAnimationName();
                    currentAnimationName = animationName;
                    break;
                case PlayOnceComplete:
                    type = AvatarAnimationEvent.EventType.STOPPED;
                    animationName = cur.getAnimationName();
                    currentAnimationName = null;
                    break;
                }
            }
  else if (cur instanceof TurnState)
View Full Code Here


//                setCurrentState((ActionState) gameStates.get(CycleActionState.class));
//                break;
               
            case Idle:
                // force idle by interrupting the current animation
                GameState state = getCurrentState();
                if (state instanceof ActionState) {
                    state.notifyAnimationMessage(AnimationMessageType.PlayOnceComplete);
                }
                break;
        }
    }
View Full Code Here

TOP

Related Classes of imi.character.statemachine.GameState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.