This commit is contained in:
2024-10-20 10:31:07 +02:00
parent fa51e53d7d
commit 0e9cdb9af5
12 changed files with 845 additions and 44 deletions

View File

@@ -10,7 +10,10 @@ public partial class Player : CharacterBody2D
[Export] TextureProgressBar bar;
[ExportGroup("controls")]
[Export] Control menu;
[Export] float minute_part_second = 1;
[Export] Label time;
float minute;
int heure = 18;
@@ -35,6 +38,14 @@ public partial class Player : CharacterBody2D
}
minute += minute_part_second * (float) delta;
if (minute >= 60)
{
minute = 0;
heure +=1;
}
UpdateTime();
Vector2 direction = Input.GetVector("left", "right", "up", "down");
direction = direction.Normalized();
@@ -85,4 +96,9 @@ public partial class Player : CharacterBody2D
Position = Position.Round();
}
void UpdateTime()
{
time.Text = string.Format("{0:D2}:{1:D2}", heure, (int)Math.Floor(minute));
}
}