Refactor course maps and travel UI
This commit is contained in:
@@ -0,0 +1,189 @@
|
||||
public static class CourseStepFactory {
|
||||
public const float GroundY = -2.4f;
|
||||
public const float AerialY = -0.85f;
|
||||
public const float BasicSpacing = 0.58f;
|
||||
public const float ActionSpacing = 0.72f;
|
||||
public const float LandingSpacing = 0.64f;
|
||||
public const float AerialSpacing = 2.05f;
|
||||
|
||||
public static CourseStep[] CreateEasyLoop() {
|
||||
return new CourseStep[] {
|
||||
Basic(),
|
||||
Jump(),
|
||||
Basic(GroundY, LandingSpacing),
|
||||
Aerial(),
|
||||
Basic(GroundY, LandingSpacing),
|
||||
Slide(SlideObstaclePattern.SlideLayout.CenterPair),
|
||||
Basic()
|
||||
};
|
||||
}
|
||||
|
||||
public static CourseStep Basic(
|
||||
float yPosition = GroundY,
|
||||
float spawnInterval = BasicSpacing,
|
||||
Platform.MileagePattern mileagePattern = Platform.MileagePattern.SafeLine,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "",
|
||||
Platform.ItemPattern itemPattern = Platform.ItemPattern.None) {
|
||||
return Step(
|
||||
Platform.PlatformPattern.Empty,
|
||||
mileagePattern,
|
||||
SlideObstaclePattern.SlideLayout.Random,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
itemPattern,
|
||||
CoursePlatformType.Basic);
|
||||
}
|
||||
|
||||
public static CourseStep Jump(
|
||||
Platform.PlatformPattern platformPattern = Platform.PlatformPattern.LowMid,
|
||||
float spawnInterval = ActionSpacing,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Step(
|
||||
platformPattern,
|
||||
Platform.MileagePattern.JumpArc,
|
||||
SlideObstaclePattern.SlideLayout.Random,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.Jump);
|
||||
}
|
||||
|
||||
public static CourseStep Jump(
|
||||
GameManager.TutorialGuideType guideType,
|
||||
string title,
|
||||
string message) {
|
||||
return Jump(Platform.PlatformPattern.LowMid, ActionSpacing, guideType, title, message);
|
||||
}
|
||||
|
||||
public static CourseStep Aerial(
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Aerial(AerialY, AerialSpacing, guideType, title, message);
|
||||
}
|
||||
|
||||
public static CourseStep Aerial(
|
||||
float yPosition,
|
||||
float spawnInterval,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Step(
|
||||
Platform.PlatformPattern.Empty,
|
||||
Platform.MileagePattern.SafeLine,
|
||||
SlideObstaclePattern.SlideLayout.Random,
|
||||
guideType,
|
||||
yPosition,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.Basic);
|
||||
}
|
||||
|
||||
public static CourseStep Slide(
|
||||
SlideObstaclePattern.SlideLayout slideLayout = SlideObstaclePattern.SlideLayout.CenterPair,
|
||||
float spawnInterval = ActionSpacing,
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.None,
|
||||
string title = "",
|
||||
string message = "") {
|
||||
return Step(
|
||||
Platform.PlatformPattern.Slide,
|
||||
Platform.MileagePattern.SlideLine,
|
||||
slideLayout,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.Slide);
|
||||
}
|
||||
|
||||
public static CourseStep Slide(
|
||||
GameManager.TutorialGuideType guideType,
|
||||
string title,
|
||||
string message) {
|
||||
return Slide(SlideObstaclePattern.SlideLayout.CenterPair, ActionSpacing, guideType, title, message);
|
||||
}
|
||||
|
||||
public static CourseStep ForceHit(
|
||||
GameManager.TutorialGuideType guideType = GameManager.TutorialGuideType.Damage,
|
||||
string title = "",
|
||||
string message = "",
|
||||
float spawnInterval = ActionSpacing) {
|
||||
return Step(
|
||||
Platform.PlatformPattern.ForceHit,
|
||||
Platform.MileagePattern.None,
|
||||
SlideObstaclePattern.SlideLayout.WidePair,
|
||||
guideType,
|
||||
GroundY,
|
||||
spawnInterval,
|
||||
title,
|
||||
message,
|
||||
Platform.ItemPattern.None,
|
||||
CoursePlatformType.ForceHit);
|
||||
}
|
||||
|
||||
public static CourseStep Step(
|
||||
Platform.PlatformPattern platformPattern,
|
||||
Platform.MileagePattern mileagePattern,
|
||||
SlideObstaclePattern.SlideLayout slideLayout,
|
||||
GameManager.TutorialGuideType guideType,
|
||||
float yPosition,
|
||||
float spawnInterval,
|
||||
string title = "",
|
||||
string message = "",
|
||||
Platform.ItemPattern itemPattern = Platform.ItemPattern.None,
|
||||
CoursePlatformType coursePlatformType = CoursePlatformType.Basic) {
|
||||
return new CourseStep {
|
||||
coursePlatformType = coursePlatformType,
|
||||
platformPattern = platformPattern,
|
||||
mileagePattern = mileagePattern,
|
||||
slideLayout = slideLayout,
|
||||
itemPattern = itemPattern,
|
||||
guideType = guideType,
|
||||
yPosition = yPosition,
|
||||
spawnInterval = spawnInterval,
|
||||
title = title,
|
||||
message = message
|
||||
};
|
||||
}
|
||||
|
||||
public static CourseStep[] CloneSteps(CourseStep[] source) {
|
||||
if(source == null)
|
||||
{
|
||||
return new CourseStep[0];
|
||||
}
|
||||
|
||||
CourseStep[] steps = new CourseStep[source.Length];
|
||||
|
||||
for(int i = 0; i < source.Length; i++)
|
||||
{
|
||||
CourseStep sourceStep = source[i];
|
||||
steps[i] = Step(
|
||||
sourceStep.platformPattern,
|
||||
sourceStep.mileagePattern,
|
||||
sourceStep.slideLayout,
|
||||
sourceStep.guideType,
|
||||
sourceStep.yPosition,
|
||||
sourceStep.spawnInterval,
|
||||
sourceStep.title,
|
||||
sourceStep.message,
|
||||
sourceStep.itemPattern,
|
||||
sourceStep.coursePlatformType);
|
||||
}
|
||||
|
||||
return steps;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user