Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ Current team members include:

#### Attributions:
First Song: <a href="https://freesound.org/people/Magntron/sounds/335571/" title="gameMusic">gameMusic by Magntron - freesound.org</a>
Input buttons by <a href="https://thoseawesomeguys.com/prompts/" title="inputkeys">Nicolae (Xelu) Berbece</a>


Input buttons by <a href="https://thoseawesomeguys.com/prompts/" title="inputkeys">Nicolae (Xelu) Berbece</a>
16 changes: 15 additions & 1 deletion scenes/BattleDirector/NotePlacementBar.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ width = 32
height = 98
fill_to = Vector2(0, 1)

[node name="NotePlacementBar" type="Control" node_paths=PackedStringArray("notePlacementBar", "currentComboMultText", "_currentNote", "_nextNote")]
[node name="NotePlacementBar" type="Control" node_paths=PackedStringArray("notePlacementBar", "currentComboMultText", "_currentNote", "_nextNote", "fullBarParticles")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
Expand All @@ -35,6 +35,7 @@ notePlacementBar = NodePath("ProgressBar")
currentComboMultText = NodePath("TextEdit")
_currentNote = NodePath("NoteQueueSprite/NextNote")
_nextNote = NodePath("NoteQueueSprite/CurrentNote")
fullBarParticles = NodePath("ProgressBar/CPUParticles2D")

[node name="ProgressBar" type="TextureProgressBar" parent="."]
layout_mode = 0
Expand All @@ -47,6 +48,19 @@ texture_under = SubResource("GradientTexture2D_hhds4")
texture_progress = SubResource("GradientTexture2D_0bqho")
texture_progress_offset = Vector2(1, 1)

[node name="CPUParticles2D" type="CPUParticles2D" parent="ProgressBar"]
position = Vector2(14, 98)
emitting = false
amount = 10
lifetime = 1.5
direction = Vector2(0, -1)
spread = 15.0
gravity = Vector2(0, 0)
initial_velocity_min = 25.0
initial_velocity_max = 50.0
scale_amount_max = 2.0
color = Color(1, 1, 0.0745098, 1)

[node name="TextEdit" type="TextEdit" parent="."]
z_as_relative = false
layout_mode = 0
Expand Down
4 changes: 3 additions & 1 deletion scenes/BattleDirector/scripts/BattleDirector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ private void OnTimedInput(Note note, ArrowType arrowType, int beat, double beatD
else
{
note.OnHit(this, timed);

NotePlacementBar.HitNote();
}
NotePlacementBar.ComboText(timed.ToString());
//NotePlacementBar.ComboText(timed.ToString());
CM.ComboText(timed.ToString(), arrowType, NotePlacementBar.GetCurrentCombo());
}

private Timing CheckTiming(double beatDif)
Expand Down
17 changes: 10 additions & 7 deletions scenes/BattleDirector/scripts/NotePlacementBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public partial class NotePlacementBar : Node
[Export]
private Sprite2D _nextNote;

[Export]
private CpuParticles2D fullBarParticles;

private Note[] _noteDeck;
private Queue<Note> _noteQueue = new Queue<Note>();

Expand Down Expand Up @@ -105,13 +108,6 @@ private Note GetNote(bool getNextNote = false)
return result;
}

public void ComboText(string text)
{
TextParticle newText = new TextParticle();
AddChild(newText);
newText.Text = text + $" {_currentCombo}";
}

// Hitting a note increases combo, combo mult, and note placement bar
public void HitNote()
{
Expand All @@ -120,6 +116,7 @@ public void HitNote()
_currentBarValue = Math.Min(_currentBarValue + comboMult, MaxValue);
UpdateNotePlacementBar(_currentBarValue);
UpdateComboMultText();
//fullBarParticles.Emitting = CanPlaceNote();
}

// Missing a note resets combo
Expand All @@ -136,6 +133,7 @@ public Note PlacedNote()
_currentBarValue -= (int)(_currentNoteInstance.CostModifier * MaxValue);

UpdateNotePlacementBar(_currentBarValue);
//fullBarParticles.Emitting = false;
return GetNote();
}

Expand All @@ -149,6 +147,11 @@ private void DetermineComboMult()
comboMult = _currentCombo / notesToIncreaseCombo + 1;
}

public int GetCurrentCombo()
{
return _currentCombo;
}

private void UpdateNotePlacementBar(int newValue)
{
notePlacementBar.Value = newValue;
Expand Down
9 changes: 5 additions & 4 deletions scenes/BattleDirector/scripts/TextParticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ public override void _Ready()
Tween tween = GetTree().CreateTween();
ZIndex = 2;
Position += Vector2.Left * (GD.Randf() * 40 - 20);
tween.SetTrans(Tween.TransitionType.Quad);
tween.SetTrans(Tween.TransitionType.Elastic);
tween.SetEase(Tween.EaseType.Out);
tween.TweenProperty(this, "position", Position + Vector2.Up * 10, .5f);
tween.TweenProperty(this, "position", Position + Vector2.Down * 20, .5f);
tween.TweenProperty(this, "position", Position + Vector2.Up * 10, .25f).AsRelative();
tween.TweenProperty(this, "position", Position + Vector2.Down * 20, .1f).AsRelative();
tween.SetParallel();
tween.TweenProperty(this, "modulate:a", 0, 1f);
tween.SetTrans(Tween.TransitionType.Quad);
tween.TweenProperty(this, "modulate:a", 0, .15f);
tween.SetParallel(false);
tween.TweenCallback(Callable.From(QueueFree));
}
Expand Down
5 changes: 3 additions & 2 deletions scenes/ChartViewport/ChartViewport.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=7 format=3 uid="uid://dfevfib11kou1"]

[ext_resource type="Script" path="res://scenes/ChartViewport/ChartManager.cs" id="1_ruh2l"]
[ext_resource type="Script" path="res://scenes/ChartViewport/scripts/ChartManager.cs" id="1_ruh2l"]
[ext_resource type="Texture2D" uid="uid://cp78odda2doab" path="res://scenes/ChartViewport/LoopMarker.png" id="2_q5cjc"]
[ext_resource type="Script" path="res://scenes/ChartViewport/Loopable.cs" id="3_5u57h"]
[ext_resource type="Script" path="res://scenes/ChartViewport/scripts/Loopable.cs" id="3_5u57h"]
[ext_resource type="PackedScene" uid="uid://bn8txx53xlguw" path="res://scenes/NoteManager/note_manager.tscn" id="4_fd5fw"]
[ext_resource type="Shader" path="res://scenes/ChartViewport/StarryNight.gdshader" id="5_kqrxg"]

Expand Down Expand Up @@ -30,6 +30,7 @@ position = Vector2(-50, 0)
anchor_mode = 0

[node name="StarShader" type="ColorRect" parent="SubViewport"]
z_index = -1
material = SubResource("ShaderMaterial_5uw0y")
offset_left = -60.0
offset_right = 415.0
Expand Down
17 changes: 17 additions & 0 deletions scenes/ChartViewport/hit_particles.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[gd_scene load_steps=2 format=3 uid="uid://bcf6vs4aqoxr5"]

[ext_resource type="Script" path="res://scenes/ChartViewport/scripts/HitParticles.cs" id="1_tr2t2"]

[node name="HitParticles" type="CPUParticles2D"]
z_index = -1
emitting = false
amount = 1
lifetime = 0.25
speed_scale = 2.01
explosiveness = 0.5
spread = 180.0
gravity = Vector2(0, 0)
initial_velocity_min = 50.0
initial_velocity_max = 200.0
scale_amount_max = 2.0
script = ExtResource("1_tr2t2")
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ private NoteArrow CreateNote(ArrowType arrow, Note note, int beat = 0)
return newArrow;
}

public void ComboText(string text, ArrowType arrow, int currentCombo)
{
TextParticle newText = new TextParticle();
AddChild(newText);
newText.Position = IH.Arrows[(int)arrow].Node.Position - newText.Size/2;
IH.FeedbackEffect(arrow, text);
newText.Text = text + $" {currentCombo}";
}

public override void _ExitTree()
{
GD.Print("[DEBUG] Stopping tweens before exiting the scene...");
Expand Down
25 changes: 25 additions & 0 deletions scenes/ChartViewport/scripts/HitParticles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using Godot;

public partial class HitParticles : CpuParticles2D
{
public void Emit(int particleAmount)
{
// Apply the particle amount and start emitting
Amount = particleAmount;
Emitting = true;

// Stop particles after a short delay using a Timer
Timer timer = new Timer();
timer.WaitTime = 0.25f; // Stop emitting after 0.5 seconds
timer.OneShot = true;
timer.Timeout += () =>
{
Emitting = false;
timer.QueueFree(); // Clean up the timer
};

AddChild(timer);
timer.Start();
}
}
11 changes: 10 additions & 1 deletion scenes/NoteManager/note_manager.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[gd_scene load_steps=6 format=3 uid="uid://bn8txx53xlguw"]
[gd_scene load_steps=7 format=3 uid="uid://bn8txx53xlguw"]

[ext_resource type="Script" path="res://scenes/NoteManager/scripts/InputHandler.cs" id="1_2oeuf"]
[ext_resource type="Texture2D" uid="uid://hfxynr5jdgsp" path="res://scenes/NoteManager/assets/new_arrow.png" id="2_pb1qk"]
[ext_resource type="Script" path="res://scenes/NoteManager/scripts/NoteChecker.cs" id="3_0cioe"]
[ext_resource type="Texture2D" uid="uid://cgq2ar3pdmkac" path="res://scenes/NoteManager/assets/arrow_outline.png" id="4_3mttx"]
[ext_resource type="Texture2D" uid="uid://b0tvsewgnf2x7" path="res://icon.svg" id="4_foklt"]
[ext_resource type="PackedScene" uid="uid://bcf6vs4aqoxr5" path="res://scenes/ChartViewport/hit_particles.tscn" id="5_jv1tr"]

[node name="noteManager" type="Node2D"]
script = ExtResource("1_2oeuf")
Expand All @@ -21,6 +22,8 @@ script = ExtResource("3_0cioe")
modulate = Color(0, 0, 0, 1)
texture = ExtResource("4_3mttx")

[node name="HitParticles" parent="noteCheckers/arrowLeft" instance=ExtResource("5_jv1tr")]

[node name="arrowUp" type="Sprite2D" parent="noteCheckers"]
position = Vector2(0, 68)
rotation = -1.5708
Expand All @@ -31,6 +34,8 @@ script = ExtResource("3_0cioe")
modulate = Color(0, 0, 0, 1)
texture = ExtResource("4_3mttx")

[node name="HitParticles" parent="noteCheckers/arrowUp" instance=ExtResource("5_jv1tr")]

[node name="arrowDown" type="Sprite2D" parent="noteCheckers"]
position = Vector2(0, 112)
rotation = 1.5708
Expand All @@ -41,6 +46,8 @@ script = ExtResource("3_0cioe")
modulate = Color(0, 0, 0, 1)
texture = ExtResource("4_3mttx")

[node name="HitParticles" parent="noteCheckers/arrowDown" instance=ExtResource("5_jv1tr")]

[node name="arrowRight" type="Sprite2D" parent="noteCheckers"]
position = Vector2(0, 151)
texture = ExtResource("2_pb1qk")
Expand All @@ -50,6 +57,8 @@ script = ExtResource("3_0cioe")
modulate = Color(0, 0, 0, 1)
texture = ExtResource("4_3mttx")

[node name="HitParticles" parent="noteCheckers/arrowRight" instance=ExtResource("5_jv1tr")]

[node name="ui" type="Node2D" parent="."]

[node name="dividers" type="Node2D" parent="ui"]
Expand Down
25 changes: 25 additions & 0 deletions scenes/NoteManager/scripts/InputHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,31 @@ private void InitializeArrowCheckers()
}
}

public void FeedbackEffect(ArrowType arrow, string text)
{
// Get the particle node for this arrow
var particles = Arrows[(int)arrow].Node.Particles;

// Set the particle amount based on timing
int particleAmount;
switch (text)
{
case "Perfect":
particleAmount = 10; // A lot of particles for Perfect
break;
case "Great":
particleAmount = 7; // Moderate amount for Great
break;
case "Good":
particleAmount = 4; // Few particles for Good
break;
default:
return; // No particles for a miss
}

particles.Emit(particleAmount);
}

public override void _Ready()
{
InitializeArrowCheckers();
Expand Down
4 changes: 3 additions & 1 deletion scenes/NoteManager/scripts/NoteChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public partial class NoteChecker : Sprite2D
private bool _isPressed;
private Color _color;
private float _fadeTime = 2.0f;
public HitParticles Particles;

public override void _Process(double delta)
{
Expand All @@ -25,7 +26,8 @@ public void SetPressed(bool pressed)
public void SetColor(Color color)
{
_color = color;

Particles = GetNode<HitParticles>("HitParticles");
Particles.Modulate = color;
SelfModulate = new Color(_color.R * 0.5f, _color.G * 0.5f, _color.B * 0.5f, 1);
}
}