public bool Update()
        {
            if (shake != null)
            {
                if (shake.IsShaking())
                {
                    shake.Update();
                    return(true);
                }
            }

            return(false);
        }
Beispiel #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;
            }
        }