コード例 #1
0
ファイル: Goomba.cs プロジェクト: Ziiiwei/MarioGame
        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()
        {
            base.Update();

            GameObjectPhysics.Update();
            GameObjectPhysics.FrictionStop(Side.Right);
            State.FrictionStop();

            positionOnScreen = GameObjectPhysics.GetPosition();
        }
コード例 #3
0
ファイル: Koopa.cs プロジェクト: Ziiiwei/MarioGame
        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();
        }
コード例 #4
0
        public override void Update()
        {
            base.Update();
            if (State.GetType() == typeof(ShroomMovingUpState))
            {
                positionOnScreen.Y -= bumpOffsets[bumpCounter];
                bumpCounter        += 1;

                if (bumpCounter == bumpOffsets.Length)
                {
                    State.ChangeDirection();
                }
            }
            else
            {
                GameObjectPhysics.Update();
                positionOnScreen = GameObjectPhysics.GetPosition();
            }
        }
コード例 #5
0
ファイル: BrickBlock.cs プロジェクト: Ziiiwei/MarioGame
 public override void Update()
 {
     base.Update();
     GameObjectPhysics.Update();
     positionOnScreen = GameObjectPhysics.GetPosition();
 }