更新状态

master
lightyears 2 years ago
parent bc7a7e1c8b
commit 6aa3ceecd4
Signed by: lightyears
GPG Key ID: 98D80DDF26D4F2F9

@ -16,12 +16,34 @@ namespace CMSGame
public Label3D StatusLabel;
public int ActionPoint;
public double ActionPointGathering;
public override void _Ready()
{
this.GetUniqueNode(ref Sprite3D, nameof(Sprite3D));
this.GetUniqueNode(ref StatusLabel, nameof(StatusLabel));
}
public override void _Process(double delta)
{
UpdateStatus(delta);
UpdateUI();
}
public void UpdateStatus(double delta)
{
ActionPointGathering += delta;
ActionPoint += (int)ActionPointGathering / 10;
ActionPointGathering %= 10;
}
public void UpdateUI()
{
StatusLabel.Text = $"HP {120}\nAP {ActionPoint}";
}
public override void _InputEvent(Camera3D camera, InputEvent @event, Vector3 position, Vector3 normal, int shapeIdx)
{
if (@event is InputEventMouseButton mouseButtonEvent)

@ -1,3 +0,0 @@
# TODO
- [x] 战斗场景搭建
Loading…
Cancel
Save