new file: .DS_Store

new file:   Audio/track.mp3
	new file:   Audio/track.mp3.import
	modified:   Charts/track.json
	modified:   Scenes/Game/level.tscn
	new file:   Scripts/.DS_Store
	modified:   Scripts/Core/GameManager.cs
	modified:   Scripts/Core/MusicClock.cs
	modified:   Scripts/Core/TrackGenerator.cs
	modified:   Scripts/Data/ChartEvent.cs
	modified:   Scripts/Data/TrackData.cs
	modified:   Scripts/GameObjects/NoteObject.cs
This commit is contained in:
CrbnsCat10n
2026-04-12 17:24:27 +08:00
parent 0e6bf1dcad
commit 778d68fd00
14 changed files with 154 additions and 38 deletions

View File

@@ -13,7 +13,7 @@ public class TempoPoint
public float BPM { get; set; }
[JsonConstructor]
public TempoPoint(double tick, float bpm, bool isLinear)
public TempoPoint(double tick, float bpm)
{
Tick = tick;
BPM = bpm;
@@ -46,7 +46,7 @@ public class ChartEvent
public double Tick { get; set; }
public Vector2 Position { get; set; }
public double HitTime { get; set; }
public double HitAbsZ { get; set; }
public float HitAbsZ { get; set; }
public ChartEvent(EventType type, double tick, Vector2 position)
{

View File

@@ -6,6 +6,7 @@ namespace Onrinto.Chart;
public class TrackData
{
public string MusicPath { get; set; }
public int BPM { get; set; }
public double Offset { get; set; }
public double TicksPerBeat { get; set; }
@@ -107,6 +108,10 @@ public class TrackData
if(point.IsLinear && idx < speedPoints.Count - 1)
{
double nextTime = TickToSeconds(speedPoints[idx + 1].Tick);
if (nextTime <= pointTime)
{
return cachedZ + (float)deltaTime * point.Speed;
}
float t = (float)((time - pointTime) / (nextTime - pointTime));
float currentSpeed = Mathf.Lerp(point.Speed, speedPoints[idx + 1].Speed, t);
return cachedZ + (float)deltaTime * (point.Speed + currentSpeed) * 0.5f;