示例#1
0
 public void AddToScene(StartingGateInfo info)
 {
     startingState = info.startingState;
     state         = info.startingState;
     type          = info.inType;
     mapPosition   = info.mapPosition;
     this.SetupAnimations();
     shake.Reset();
 }
示例#2
0
        public void Update()
        {
            CGPoint displayPosition;

            if (shake.IsShaking())
            {
                shake.Update();
                CGPoint displayPosition2 = this.GetDisplayPosition(animOpen.GetFrame());
                displayPosition2.x += shake.x;
                displayPosition2.y += shake.y;
                ((Globals.g_world.game).GetMapObject(mapObjectId)).SetPosition(displayPosition2);
            }

            switch (state)
            {
            case StartingGateState.e_Opening:
                animOpen.Update();
                if (animOpen.state == AnimationState.kAnimFinished)
                {
                    state = StartingGateState.e_Open;
                }

                ((Globals.g_world.game).GetMapObject(mapObjectId)).SetSubTextureId(animOpen.GetSubTextureId());
                displayPosition = this.GetDisplayPosition(animOpen.GetFrame());
                ((Globals.g_world.game).GetMapObject(mapObjectId)).SetPosition(displayPosition);
                break;

            case StartingGateState.e_Closing:
                animClose.Update();
                if (animClose.state == AnimationState.kAnimFinished)
                {
                    state = StartingGateState.e_Closed;
                }

                ((Globals.g_world.game).GetMapObject(mapObjectId)).SetSubTextureId(animClose.GetSubTextureId());
                displayPosition = this.GetDisplayPosition(5 - animClose.GetFrame());
                ((Globals.g_world.game).GetMapObject(mapObjectId)).SetPosition(displayPosition);
                break;

            default:
                break;
            }
        }
示例#3
0
 public void Reset()
 {
     state       = startingState;
     mapObjectId = -1;
 }
示例#4
0
 public void Close()
 {
     state = StartingGateState.e_Closing;
     animClose.PlayOnce();
 }
示例#5
0
 public void Open()
 {
     state = StartingGateState.e_Opening;
     animOpen.PlayOnce();
     (SoundEngine.Instance()).PlayFinchSound((int)Audio.Enum1.kSoundEffect_GateOpen);
 }