Skip to content

Commit 450197b

Browse files
committed
Removed placeholder arrow, fixed loop missing, added player puppet
Replaced old arrow graphic with new custom one Player arrow is unique color Reverted CheckMiss(), upon looping, without input no notes would miss Player puppet with WIP player stats object. RelicTemplate class to placehold for inventory
1 parent fc51749 commit 450197b

15 files changed

Lines changed: 88 additions & 38 deletions

File tree

Classes/Note.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public partial class Note : Resource
1010
{
1111
private string _effect;
1212

13+
//public Puppet_Template Owner;
14+
1315
public Note(string effect = "")
1416
{
1517
_effect = effect;

Classes/RelicTemplate.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using Godot;
3+
4+
public partial class RelicTemplate : Resource
5+
{
6+
public string[] EffectTags;
7+
public string Name;
8+
9+
//public Texture2D Texture
10+
//public string Tooltip
11+
public RelicTemplate(string Name = "", string[] EffectTags = null) { }
12+
}

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Current team members include:
1414

1515

1616
#### Attributions:
17-
Note icon: <a href="https://www.flaticon.com/free-icons/next" title="next icons">Next icons created by Pixel perfect - Flaticon</a>
18-
1917
First Song: <a href="https://freesound.org/people/Magntron/sounds/335571/" title="gameMusic">gameMusic by Magntron - freesound.org</a>
2018

2119

-334 Bytes
Loading

scenes/BattleDirector/scripts/BattleDirector.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
* @brief Higher priority director to manage battle effects. Can directly access managers, which should signal up to Director WIP
1111
*/
1212
public partial class BattleDirector : Node2D
13-
{
13+
{ //TODO: Maybe move some Director functionality to a sub node.
1414
#region Declarations
15-
private Puppet_Template Player;
16-
private Puppet_Template Enemy;
15+
//private Puppet_Template[] ActivePuppets;
16+
private PuppetTemplate Player;
17+
private PuppetTemplate Enemy;
1718

1819
[Export]
1920
private ChartManager CM;
@@ -78,14 +79,21 @@ private bool AddNoteToLane(ArrowType type, int beat, bool isActive = true)
7879
return false;
7980
}
8081
//Get noteArrow from CM
81-
var arrow = CM.AddArrowToLane(type, beat, _notes.Length - 1);
82+
NoteArrow arrow;
83+
if (isActive)
84+
{
85+
arrow = CM.AddArrowToLane(type, beat, _notes.Length - 1);
86+
}
87+
else
88+
{
89+
arrow = CM.AddArrowToLane(type, beat, _notes.Length - 1, new Color(1, 0.43f, 0.26f));
90+
}
8291
arrow.IsActive = isActive;
8392
_laneData[(int)type][beat] = arrow;
8493
return true;
8594
}
8695
#endregion
8796

88-
//Creeate dummy notes
8997
private void AddExampleNotes()
9098
{
9199
GD.Print(CM.BeatsPerLoop);
@@ -116,7 +124,7 @@ public override void _Ready()
116124
NumLoops = 5,
117125
};
118126

119-
Player = new Puppet_Template();
127+
Player = new PlayerPuppet();
120128
AddChild(Player);
121129
Player.Init(
122130
GD.Load<Texture2D>("res://scenes/BattleDirector/assets/Character1.png"),
@@ -125,7 +133,7 @@ public override void _Ready()
125133
Player.SetPosition(new Vector2(80, 0));
126134
Player.Sprite.Position += Vector2.Down * 30; //TEMP
127135

128-
Enemy = new Puppet_Template();
136+
Enemy = new PuppetTemplate();
129137
Enemy.SetPosition(new Vector2(400, 0));
130138
AddChild(Enemy);
131139
Enemy.Init(GD.Load<Texture2D>("res://scenes/BattleDirector/assets/Enemy1.png"), "Enemy");
@@ -184,9 +192,12 @@ private void CheckMiss()
184192
double realBeat = TimeKeeper.CurrentTime / (60 / (double)_curSong.Bpm) % CM.BeatsPerLoop;
185193
for (int i = 0; i < _laneData.Length; i++)
186194
{
187-
if (!(_laneLastBeat[i] < Math.Floor(realBeat)))
195+
if (
196+
!(_laneLastBeat[i] < Math.Floor(realBeat))
197+
&& (_laneLastBeat[i] != CM.BeatsPerLoop - 1 || Math.Floor(realBeat) != 0)
198+
)
188199
continue;
189-
if (!IsNoteActive((ArrowType)i, _laneLastBeat[i]))
200+
if (_laneData[i][_laneLastBeat[i]] == null || !_laneData[i][_laneLastBeat[i]].IsActive)
190201
{
191202
_laneLastBeat[i] = (_laneLastBeat[i] + 1) % CM.BeatsPerLoop;
192203
continue;

scenes/ChartViewport/ChartManager.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ public void PrepChart(BattleDirector.SongData songData)
5959
tween
6060
.TweenMethod(
6161
Callable.From((Vector2 scale) => TweenArrows(scale)),
62-
new Vector2(0.07f, 0.07f),
63-
new Vector2(0.07f, 0.07f) * 1.25f,
62+
Vector2.One * .8f,
63+
Vector2.One,
6464
60f / TimeKeeper.Bpm / 2
6565
)
6666
.SetEase(Tween.EaseType.Out)
6767
.SetTrans(Tween.TransitionType.Elastic);
6868
tween.TweenMethod(
6969
Callable.From((Vector2 scale) => TweenArrows(scale)),
70-
new Vector2(0.07f, 0.07f) * 1.25f,
71-
new Vector2(0.07f, 0.07f),
70+
Vector2.One,
71+
Vector2.One * .8f,
7272
60f / TimeKeeper.Bpm / 2
7373
);
7474
tween.SetLoops().Play();
@@ -98,10 +98,20 @@ private void TweenArrows(Vector2 scale)
9898
}
9999
}
100100

101-
public NoteArrow AddArrowToLane(ArrowType type, int beat, int noteIdx)
101+
public NoteArrow AddArrowToLane(
102+
ArrowType type,
103+
int beat,
104+
int noteIdx,
105+
Color colorOverride = default
106+
)
102107
{
103108
var newNote = CreateNote(type, beat);
104-
CreateNote(type, beat + BeatsPerLoop); //Create a dummy arrow for looping visuals
109+
var loopArrow = CreateNote(type, beat + BeatsPerLoop); //Create a dummy arrow for looping visuals
110+
if (colorOverride != default)
111+
{
112+
newNote.Modulate = colorOverride;
113+
loopArrow.Modulate = colorOverride;
114+
}
105115
newNote.NoteIdx = noteIdx;
106116
return newNote;
107117
}
607 Bytes
Loading

scenes/NoteManager/assets/right-arrow.png.import renamed to scenes/NoteManager/assets/outline_white.png.import

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
importer="texture"
44
type="CompressedTexture2D"
5-
uid="uid://bucvj4fquqpkr"
6-
path="res://.godot/imported/right-arrow.png-b3005485b42777a77a9d39fbba48875d.ctex"
5+
uid="uid://xtygvpk7s8e4"
6+
path="res://.godot/imported/outline_white.png-eff17a86b93281db885f81fdb608ab83.ctex"
77
metadata={
88
"vram_texture": false
99
}
1010

1111
[deps]
1212

13-
source_file="res://scenes/NoteManager/assets/right-arrow.png"
14-
dest_files=["res://.godot/imported/right-arrow.png-b3005485b42777a77a9d39fbba48875d.ctex"]
13+
source_file="res://scenes/NoteManager/assets/outline_white.png"
14+
dest_files=["res://.godot/imported/outline_white.png-eff17a86b93281db885f81fdb608ab83.ctex"]
1515

1616
[params]
1717

-14.3 KB
Binary file not shown.

scenes/NoteManager/note.tscn

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[gd_scene load_steps=3 format=3 uid="uid://ck3bfqy30rjbq"]
22

3-
[ext_resource type="Texture2D" uid="uid://bucvj4fquqpkr" path="res://scenes/NoteManager/assets/right-arrow.png" id="1_kubiy"]
3+
[ext_resource type="Texture2D" uid="uid://xtygvpk7s8e4" path="res://scenes/NoteManager/assets/outline_white.png" id="1_vs4mw"]
44
[ext_resource type="Script" path="res://scenes/NoteManager/scripts/NoteArrow.cs" id="2_lbl4b"]
55

66
[node name="Right-arrow" type="Sprite2D"]
7-
scale = Vector2(0.07, 0.07)
8-
texture = ExtResource("1_kubiy")
7+
texture = ExtResource("1_vs4mw")
98
script = ExtResource("2_lbl4b")

0 commit comments

Comments
 (0)