diff options
author | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 16:08:09 +0200 |
---|---|---|
committer | IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> | 2022-07-17 16:08:09 +0200 |
commit | 37569906966cc4cd33278c5e2ad0aae9755aee33 (patch) | |
tree | 7137d7b29de630f5a286627462d184e159e8229a /godot/scenes/objects/Scoreboard.gd | |
parent | 48d4f9de2536be2617aec3d58697a0db061d038c (diff) | |
download | 2022-37569906966cc4cd33278c5e2ad0aae9755aee33.tar.gz 2022-37569906966cc4cd33278c5e2ad0aae9755aee33.tar.bz2 2022-37569906966cc4cd33278c5e2ad0aae9755aee33.zip |
updated scoreboard to have only 3 holes and added sum at the end
Diffstat (limited to 'godot/scenes/objects/Scoreboard.gd')
-rw-r--r-- | godot/scenes/objects/Scoreboard.gd | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/godot/scenes/objects/Scoreboard.gd b/godot/scenes/objects/Scoreboard.gd index 0f6d32b..4c9ab2b 100644 --- a/godot/scenes/objects/Scoreboard.gd +++ b/godot/scenes/objects/Scoreboard.gd @@ -4,19 +4,18 @@ func update_values(values, pars): $Panel/GridContainer/Player0.text = "%d" % values[0] $Panel/GridContainer/Player1.text = "%d" % values[1] $Panel/GridContainer/Player2.text = "%d" % values[2] - $Panel/GridContainer/Player3.text = "%d" % values[3] - $Panel/GridContainer/Player4.text = "%d" % values[4] - $Panel/GridContainer/Player5.text = "%d" % values[5] - $Panel/GridContainer/Player6.text = "%d" % values[6] - $Panel/GridContainer/Player7.text = "%d" % values[7] - $Panel/GridContainer/Player8.text = "%d" % values[8] + + var sum = 0 + for i in values: + sum += i + $Panel/GridContainer/PlayerSum.text = "%d" % sum $Panel/GridContainer/Par0.text = "%d" % pars[0] $Panel/GridContainer/Par1.text = "%d" % pars[1] $Panel/GridContainer/Par2.text = "%d" % pars[2] - $Panel/GridContainer/Par3.text = "%d" % pars[3] - $Panel/GridContainer/Par4.text = "%d" % pars[4] - $Panel/GridContainer/Par5.text = "%d" % pars[5] - $Panel/GridContainer/Par6.text = "%d" % pars[6] - $Panel/GridContainer/Par7.text = "%d" % pars[7] - $Panel/GridContainer/Par8.text = "%d" % pars[8] + + sum = 0 + for i in pars: + sum += i + + $Panel/GridContainer/ParSum.text = "%d" % sum |