1 Commits

2 changed files with 17 additions and 15 deletions

View File

@ -335,7 +335,7 @@
{ {
"type": "CubePortal", "type": "CubePortal",
"x": 363.0, "x": 363.0,
"y": 5.0, "y": 4.3,
"scaleX": 1.0, "scaleX": 1.0,
"scaleY": 1.0, "scaleY": 1.0,
"rotationZ": 0.0 "rotationZ": 0.0
@ -2044,14 +2044,6 @@
"scaleY": 0.10999999940395355, "scaleY": 0.10999999940395355,
"rotationZ": 180.0 "rotationZ": 180.0
}, },
{
"type": "Spike",
"x": 329.8699951171875,
"y": 9.8100004196167,
"scaleX": 0.15000000596046449,
"scaleY": 0.15000000596046449,
"rotationZ": 180.0
},
{ {
"type": "Spike", "type": "Spike",
"x": 293.70001220703127, "x": 293.70001220703127,
@ -2059,6 +2051,14 @@
"scaleX": 0.15000000596046449, "scaleX": 0.15000000596046449,
"scaleY": 0.15000000596046449, "scaleY": 0.15000000596046449,
"rotationZ": 0.0 "rotationZ": 0.0
},
{
"type": "Spike",
"x": 329.8699951171875,
"y": 9.8100004196167,
"scaleX": 0.15000000596046449,
"scaleY": 0.15000000596046449,
"rotationZ": 180.0
} }
] ]
} }

View File

@ -17,7 +17,7 @@ public class LevelElement
[System.Serializable] [System.Serializable]
public class Level public class Level
{ {
public static readonly int LAST_X = 15; public static readonly int LAST_X = 25;
public string JsonName { get; set; } public string JsonName { get; set; }
public int TotalJumps { get; set; } public int TotalJumps { get; set; }
public int TotalAttempts { get; set; } public int TotalAttempts { get; set; }
@ -35,13 +35,15 @@ public class Level
{ {
get get
{ {
LevelElement lastElement = elements[^1]; float maxX = LAST_X;
float lastX = LAST_X; foreach (var element in elements)
if (lastElement != null)
{ {
lastX += lastElement.x; if (element.x > maxX)
{
maxX = element.x;
} }
return lastX; }
return maxX + LAST_X;
} }
} }