From 6aa3ceecd42c8945c3cb99537630894a7935b35a Mon Sep 17 00:00:00 2001 From: lightyears Date: Mon, 20 Feb 2023 18:38:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Models/BattleCharacter.cs | 22 ++++++++++++++++++++++ TODO.md | 3 --- 2 files changed, 22 insertions(+), 3 deletions(-) delete mode 100644 TODO.md diff --git a/Models/BattleCharacter.cs b/Models/BattleCharacter.cs index 1b7e0e3..7137b58 100644 --- a/Models/BattleCharacter.cs +++ b/Models/BattleCharacter.cs @@ -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) diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 2888bf3..0000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -# TODO - -- [x] 战斗场景搭建