Skip to content

Commit 55de3ec

Browse files
committed
Small cleanup
Start battle on start button press
1 parent 175a64b commit 55de3ec

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Globals/Scribe.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public partial class Scribe : Node
3434
),
3535
new Note(
3636
"PlayerDouble",
37-
"Basic player note, deals damage to enemy",
38-
GD.Load<Texture2D>("res://Classes/Notes/assets/single_note.png"),
37+
"Basic player note, deals double damage to enemy",
38+
GD.Load<Texture2D>("res://Classes/Notes/assets/double_note.png"),
3939
null,
4040
1,
4141
(director, note, timing) =>

scenes/BattleDirector/scripts/BattleDirector.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public PuppetTemplate GetTarget(Note note)
6060
#region Initialization
6161
public override void _Ready()
6262
{
63+
//TODO: Should come from transition into battle
6364
_curSong = new SongData
6465
{
6566
Bpm = 120,
@@ -80,10 +81,18 @@ public override void _Ready()
8081
AddChild(Enemy);
8182
Enemy.Defeated += CheckBattleStatus;
8283
Enemy.Init(GD.Load<Texture2D>("res://scenes/BattleDirector/assets/Enemy1.png"), "Enemy");
83-
Enemy.Sprite.Scale *= 2;
8484

85-
var timer = GetTree().CreateTimer(AudioServer.GetTimeToNextMix());
86-
timer.Timeout += Begin;
85+
//TODO: This is a temporary measure
86+
Button startButton = new Button();
87+
startButton.Text = "Start";
88+
startButton.Position = GetViewportRect().Size / 2;
89+
AddChild(startButton);
90+
startButton.Pressed += () =>
91+
{
92+
var timer = GetTree().CreateTimer(AudioServer.GetTimeToNextMix());
93+
timer.Timeout += Begin;
94+
startButton.QueueFree();
95+
};
8796
}
8897

8998
//TODO: This will all change
@@ -93,7 +102,8 @@ private void Begin()
93102
CD.Prep();
94103
CD.TimedInput += OnTimedInput;
95104

96-
//TEMP TODO: Make enemies, can put this in an enemy subclass
105+
//TODO: Make enemies, can put this in an enemy subclass
106+
Enemy.Sprite.Scale *= 2;
97107
var enemTween = CreateTween();
98108
enemTween.TweenProperty(Enemy.Sprite, "position", Vector2.Down * 5, 1f).AsRelative();
99109
enemTween.TweenProperty(Enemy.Sprite, "position", Vector2.Up * 5, 1f).AsRelative();
@@ -159,9 +169,8 @@ private void OnTimedInput(Note note, ArrowType arrowType, int beat, double beatD
159169
PlayerAddNote(arrowType, beat);
160170
return;
161171
}
162-
//TODO: Evaluate Timing as a function
172+
163173
Timing timed = CheckTiming(beatDif);
164-
GD.Print(timed);
165174

166175
if (timed == Timing.Miss)
167176
{

0 commit comments

Comments
 (0)