Skip to content

Commit 01a0101

Browse files
committed
Added documentation.
1 parent 2b3f9f1 commit 01a0101

File tree

9 files changed

+324
-0
lines changed

9 files changed

+324
-0
lines changed

Documentation/API/Common/InverseLerp.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ int main()
3131
return 0;
3232
}
3333
```
34+
35+
##### Godot
36+
37+
```gdscript
38+
extends Node
39+
40+
func _ready() -> void:
41+
var value = rhythm_game_utilities.inverse_lerp(0, 10, 5)
42+
43+
print(value) # 0.5
44+
```

Documentation/API/Common/Lerp.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ int main()
3131
return 0;
3232
}
3333
```
34+
35+
##### Godot
36+
37+
```gdscript
38+
extends Node
39+
40+
func _ready() -> void:
41+
var value = rhythm_game_utilities.lerp(0, 10, 0.5)
42+
43+
print(value) # 5
44+
```

Documentation/API/Utilities/ConvertSecondsToTicks.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,23 @@ int main()
5252
return 0;
5353
}
5454
```
55+
56+
##### Godot
57+
58+
```gdscript
59+
extends Node
60+
61+
func _ready() -> void:
62+
var seconds = 5;
63+
var resolution = 192;
64+
65+
var bpmChanges = {
66+
0: 88000, 3840: 112000, 9984: 89600,
67+
22272: 112000, 33792: 111500, 34560: 112000,
68+
42240: 111980
69+
}
70+
71+
var ticks = rhythm_game_utilities.convert_seconds_to_ticks(seconds, resolution, bpmChanges);
72+
73+
print(ticks) # 1408
74+
```

Documentation/API/Utilities/ConvertTickToPosition.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,17 @@ int main()
3737
return 0;
3838
}
3939
```
40+
41+
##### Godot
42+
43+
```gdscript
44+
extends Node
45+
46+
func _ready() -> void:
47+
var tick = 2784;
48+
var resolution = 192;
49+
50+
var position = rhythm_game_utilities.convert_tick_to_position(tick, resolution);
51+
52+
print(position) # 14.5
53+
```

Documentation/API/Utilities/IsOnTheBeat.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,17 @@ int main()
4141
return 0;
4242
}
4343
```
44+
45+
##### Godot
46+
47+
```gdscript
48+
extends Node
49+
50+
func _ready() -> void:
51+
var bpm = 120;
52+
var currentTime = 10;
53+
var delta = 0.05;
54+
55+
if rhythm_game_utilities.is_on_the_beat(bpm, currentTime, delta):
56+
print("Is on the beat!")
57+
```

Documentation/API/Utilities/RoundUpToTheNearestMultiplier.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ int main()
3131
return 0;
3232
}
3333
```
34+
35+
##### Godot
36+
37+
```gdscript
38+
extends Node
39+
40+
func _ready() -> void:
41+
var value = rhythm_game_utilities.round_up_to_the_nearest_multiplier(12, 10);
42+
43+
print(value) # 20
44+
```

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ int main()
263263
}
264264
```
265265

266+
##### Godot
267+
268+
```gdscript
269+
extends Node
270+
271+
func _ready() -> void:
272+
var value = rhythm_game_utilities.inverse_lerp(0, 10, 5)
273+
274+
print(value) # 0.5
275+
```
276+
266277
#### `Common.Lerp`
267278

268279
> Languages: `C#` `C++`
@@ -297,6 +308,17 @@ int main()
297308
}
298309
```
299310

311+
##### Godot
312+
313+
```gdscript
314+
extends Node
315+
316+
func _ready() -> void:
317+
var value = rhythm_game_utilities.lerp(0, 10, 0.5)
318+
319+
print(value) # 5
320+
```
321+
300322
### `Parsers`
301323

302324
Read more about `.chart` files: <https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/.chart/Core%20Infrastructure.md>
@@ -724,6 +746,26 @@ int main()
724746
}
725747
```
726748

749+
##### Godot
750+
751+
```gdscript
752+
extends Node
753+
754+
func _ready() -> void:
755+
var seconds = 5;
756+
var resolution = 192;
757+
758+
var bpmChanges = {
759+
0: 88000, 3840: 112000, 9984: 89600,
760+
22272: 112000, 33792: 111500, 34560: 112000,
761+
42240: 111980
762+
}
763+
764+
var ticks = rhythm_game_utilities.convert_seconds_to_ticks(seconds, resolution, bpmChanges);
765+
766+
print(ticks) # 1408
767+
```
768+
727769
#### `Utilities.ConvertTickToPosition`
728770

729771
> Languages: `C#` `C++`
@@ -764,6 +806,20 @@ int main()
764806
}
765807
```
766808

809+
##### Godot
810+
811+
```gdscript
812+
extends Node
813+
814+
func _ready() -> void:
815+
var tick = 2784;
816+
var resolution = 192;
817+
818+
var position = rhythm_game_utilities.convert_tick_to_position(tick, resolution);
819+
820+
print(position) # 14.5
821+
```
822+
767823
#### `Utilities.IsOnTheBeat`
768824

769825
> Languages: `C#` `C++`
@@ -808,6 +864,20 @@ int main()
808864
}
809865
```
810866

867+
##### Godot
868+
869+
```gdscript
870+
extends Node
871+
872+
func _ready() -> void:
873+
var bpm = 120;
874+
var currentTime = 10;
875+
var delta = 0.05;
876+
877+
if rhythm_game_utilities.is_on_the_beat(bpm, currentTime, delta):
878+
print("Is on the beat!")
879+
```
880+
811881
#### `Utilities.RoundUpToTheNearestMultiplier`
812882

813883
> Languages: `C#` `C++`
@@ -842,6 +912,17 @@ int main()
842912
}
843913
```
844914

915+
##### Godot
916+
917+
```gdscript
918+
extends Node
919+
920+
func _ready() -> void:
921+
var value = rhythm_game_utilities.round_up_to_the_nearest_multiplier(12, 10);
922+
923+
print(value) # 20
924+
```
925+
845926
## Architecture
846927

847928
The current architecture for this project looks like this:

RhythmGameUtilities/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ int main()
263263
}
264264
```
265265

266+
##### Godot
267+
268+
```gdscript
269+
extends Node
270+
271+
func _ready() -> void:
272+
var value = rhythm_game_utilities.inverse_lerp(0, 10, 5)
273+
274+
print(value) # 0.5
275+
```
276+
266277
#### `Common.Lerp`
267278

268279
> Languages: `C#` `C++`
@@ -297,6 +308,17 @@ int main()
297308
}
298309
```
299310

311+
##### Godot
312+
313+
```gdscript
314+
extends Node
315+
316+
func _ready() -> void:
317+
var value = rhythm_game_utilities.lerp(0, 10, 0.5)
318+
319+
print(value) # 5
320+
```
321+
300322
### `Parsers`
301323

302324
Read more about `.chart` files: <https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/.chart/Core%20Infrastructure.md>
@@ -724,6 +746,26 @@ int main()
724746
}
725747
```
726748

749+
##### Godot
750+
751+
```gdscript
752+
extends Node
753+
754+
func _ready() -> void:
755+
var seconds = 5;
756+
var resolution = 192;
757+
758+
var bpmChanges = {
759+
0: 88000, 3840: 112000, 9984: 89600,
760+
22272: 112000, 33792: 111500, 34560: 112000,
761+
42240: 111980
762+
}
763+
764+
var ticks = rhythm_game_utilities.convert_seconds_to_ticks(seconds, resolution, bpmChanges);
765+
766+
print(ticks) # 1408
767+
```
768+
727769
#### `Utilities.ConvertTickToPosition`
728770

729771
> Languages: `C#` `C++`
@@ -764,6 +806,20 @@ int main()
764806
}
765807
```
766808

809+
##### Godot
810+
811+
```gdscript
812+
extends Node
813+
814+
func _ready() -> void:
815+
var tick = 2784;
816+
var resolution = 192;
817+
818+
var position = rhythm_game_utilities.convert_tick_to_position(tick, resolution);
819+
820+
print(position) # 14.5
821+
```
822+
767823
#### `Utilities.IsOnTheBeat`
768824

769825
> Languages: `C#` `C++`
@@ -808,6 +864,20 @@ int main()
808864
}
809865
```
810866

867+
##### Godot
868+
869+
```gdscript
870+
extends Node
871+
872+
func _ready() -> void:
873+
var bpm = 120;
874+
var currentTime = 10;
875+
var delta = 0.05;
876+
877+
if rhythm_game_utilities.is_on_the_beat(bpm, currentTime, delta):
878+
print("Is on the beat!")
879+
```
880+
811881
#### `Utilities.RoundUpToTheNearestMultiplier`
812882

813883
> Languages: `C#` `C++`
@@ -842,6 +912,17 @@ int main()
842912
}
843913
```
844914

915+
##### Godot
916+
917+
```gdscript
918+
extends Node
919+
920+
func _ready() -> void:
921+
var value = rhythm_game_utilities.round_up_to_the_nearest_multiplier(12, 10);
922+
923+
print(value) # 20
924+
```
925+
845926
## Architecture
846927

847928
The current architecture for this project looks like this:

0 commit comments

Comments
 (0)