Ejemplo n.º 1
0
        public static float GetJumpObstacleWidth()
        {
            float minimumHorizontalDistanceRequired = 0;

            for (float time = 0; time < 100; time += 1.0f / GeneralValues.FPS)
            {
                if (GetYDifferenceAfterJump(time) > GetJumpObstacleHeight())
                {
                    minimumHorizontalDistanceRequired = time * PhysicsValues.GetHorizontalPlayerVelocity();
                    break;
                }
            }

            float halfJumpObstacleWidth = PhysicsValues.GetPlainJumpLength() / 2.0f;

            halfJumpObstacleWidth -= MaximumJumpObstacleJumpTimingOffset * PhysicsValues.GetHorizontalPlayerVelocity();
            halfJumpObstacleWidth -= minimumHorizontalDistanceRequired;
            halfJumpObstacleWidth -= PhysicsValues.GetHalfPlayerHitboxWidth();

            return(halfJumpObstacleWidth * 2 * GeneralValues.DifficultyFactor);
        }
Ejemplo n.º 2
0
 private float GetPlayerRightEdgeXByTime(float time)
 {
     return(GetXPositionByTime(time) + PhysicsValues.GetHalfPlayerHitboxWidth());
 }