feat: level progression (#46)

This commit is contained in:
2025-03-17 18:28:27 +01:00
committed by GitHub
parent a9bd2a0048
commit 872772d3f0
18 changed files with 1717 additions and 35 deletions

View File

@ -16,9 +16,12 @@ public class LevelElement
[System.Serializable]
public class Level
{
public static readonly int LAST_X = 15;
public string JsonName { get; set; }
public int TotalJumps { get; set; }
public int TotalAttempts { get; set; }
public int ProgressionPercent { get; set; }
public int ProgressionPercentMax { get; set; }
public string name;
public string musicName;
@ -26,6 +29,20 @@ public class Level
public List<LevelElement> elements;
public float LastX
{
get
{
LevelElement lastElement = elements[^1];
float lastX = LAST_X;
if (lastElement != null)
{
lastX += lastElement.x;
}
return lastX;
}
}
public static Level CreateFromJSON(string jsonString)
{
return JsonUtility.FromJson<Level>(jsonString);