示例#1
0
        public override void Update()
        {
            if (State.GetType() == typeof(StompedGoombaState))
            {
                if (stompTimer == stompTimerBound)
                {
                    World.Instance.RemoveFromWorld(Uid);
                    return;
                }
                else
                {
                    stompTimer++;
                }
            }
            Sprite.Update();

            // This can be reworked by adding this CONSTANT ACCEL functionality into Physics.
            if (State.GetType() == typeof(LeftMovingGoombaState))
            {
                GameObjectPhysics.Move(Side.Left);
            }
            else if (State.GetType() == typeof(RightMovingGoombaState))
            {
                GameObjectPhysics.Move(Side.Right);
            }
            GameObjectPhysics.Update();
            positionOnScreen = GameObjectPhysics.GetPosition();
        }
示例#2
0
        public override void Update()
        {
            Sprite.Update();

            // This can be reworked by adding this CONSTANT ACCEL functionality into Physics.
            if (State.GetType() == typeof(KoopaMovingLeftState))
            {
                GameObjectPhysics.Move(Side.Left);
            }
            else if (State.GetType() == typeof(KoopaMovingRightState))
            {
                GameObjectPhysics.Move(Side.Right);
            }
            GameObjectPhysics.Update();
            positionOnScreen = GameObjectPhysics.GetPosition();
        }