mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
fix: should correctly place the winner wall, by determining the max x of a level
This commit is contained in:
@ -335,7 +335,7 @@
|
||||
{
|
||||
"type": "CubePortal",
|
||||
"x": 363.0,
|
||||
"y": 5.0,
|
||||
"y": 4.3,
|
||||
"scaleX": 1.0,
|
||||
"scaleY": 1.0,
|
||||
"rotationZ": 0.0
|
||||
@ -2044,14 +2044,6 @@
|
||||
"scaleY": 0.10999999940395355,
|
||||
"rotationZ": 180.0
|
||||
},
|
||||
{
|
||||
"type": "Spike",
|
||||
"x": 329.8699951171875,
|
||||
"y": 9.8100004196167,
|
||||
"scaleX": 0.15000000596046449,
|
||||
"scaleY": 0.15000000596046449,
|
||||
"rotationZ": 180.0
|
||||
},
|
||||
{
|
||||
"type": "Spike",
|
||||
"x": 293.70001220703127,
|
||||
@ -2059,6 +2051,14 @@
|
||||
"scaleX": 0.15000000596046449,
|
||||
"scaleY": 0.15000000596046449,
|
||||
"rotationZ": 0.0
|
||||
},
|
||||
{
|
||||
"type": "Spike",
|
||||
"x": 329.8699951171875,
|
||||
"y": 9.8100004196167,
|
||||
"scaleX": 0.15000000596046449,
|
||||
"scaleY": 0.15000000596046449,
|
||||
"rotationZ": 180.0
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ public class LevelElement
|
||||
[System.Serializable]
|
||||
public class Level
|
||||
{
|
||||
public static readonly int LAST_X = 15;
|
||||
public static readonly int LAST_X = 25;
|
||||
public string JsonName { get; set; }
|
||||
public int TotalJumps { get; set; }
|
||||
public int TotalAttempts { get; set; }
|
||||
@ -35,13 +35,15 @@ public class Level
|
||||
{
|
||||
get
|
||||
{
|
||||
LevelElement lastElement = elements[^1];
|
||||
float lastX = LAST_X;
|
||||
if (lastElement != null)
|
||||
float maxX = LAST_X;
|
||||
foreach (var element in elements)
|
||||
{
|
||||
lastX += lastElement.x;
|
||||
if (element.x > maxX)
|
||||
{
|
||||
maxX = element.x;
|
||||
}
|
||||
return lastX;
|
||||
}
|
||||
return maxX + LAST_X;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user