|
| 1 | +using Godot; |
| 2 | +using System; |
| 3 | + |
| 4 | +//Lets say this inits all the initial notes and manages the chart BG. |
| 5 | + |
| 6 | +//What does this do? |
| 7 | +//Input, visual looping, timing, battle stuff, combo, note creation |
| 8 | + |
| 9 | +//Focus on the looping |
| 10 | +/* |
| 11 | +
|
| 12 | + This should manage creating sprites for notes??? |
| 13 | + This should manage subview camera pos and zoom. |
| 14 | +
|
| 15 | +Movement should primarily be done from a parent node |
| 16 | +BackGround probably needs 2 sprites or parallax: |
| 17 | + Get a set length, based on viewport and loop/song length (Const PLAYWIDTH) |
| 18 | + Once one BG hits a certain left pos return it to the right pos |
| 19 | +
|
| 20 | +Notes are similar, but only need 1 representation. |
| 21 | + Once hits left bounds return to right bounds |
| 22 | + (Something else should probably manage refreshing, input, etc) |
| 23 | + Can probably use an object pool |
| 24 | +
|
| 25 | +If timing based input checking: |
| 26 | + This is enough, notes are visually just sprites |
| 27 | + Collision based - This might need to manage that, or have a sister manager that does, notes need more stuff on their own |
| 28 | + */ |
| 29 | + |
| 30 | +public partial class ChartManager : SubViewportContainer |
| 31 | +{ |
| 32 | + |
| 33 | + //Simulated variables, remove later |
| 34 | + private const int Bpm = 120; |
| 35 | + private const double SongLength = 160; //secs |
| 36 | + |
| 37 | + //Arbitrary vars, play with these |
| 38 | + private const double ChartLength = 1400; |
| 39 | + private const int NumLoops = 5; //TODO: Loops should be based on measures of a song? |
| 40 | + |
| 41 | + //Nodes from scene |
| 42 | + [Export] public CanvasGroup ChartLoopables; |
| 43 | + |
| 44 | + private double _loopLen; //secs |
| 45 | + private int _beatsPerLoop; |
| 46 | + |
| 47 | + public override void _Ready() |
| 48 | + { |
| 49 | + _loopLen = SongLength / NumLoops; |
| 50 | + _beatsPerLoop = (int)(_loopLen / (60f / Bpm)); |
| 51 | + |
| 52 | + |
| 53 | + } |
| 54 | + |
| 55 | + public override void _Process(double delta) |
| 56 | + { |
| 57 | + //ChartLoopables.Position += 10 * Vector2.Left; |
| 58 | + } |
| 59 | +} |
0 commit comments