mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Just some small code corrections
1º - Missing quotation marks 2º - Damage calculation was resulting in negative numbers.
This commit is contained in:
committed by
Rémi Verschelde
parent
c267e81350
commit
5067b9b58b
@@ -1529,7 +1529,7 @@ the :ref:`Object.connect() <class_Object_method_connect>` method:
|
||||
|
||||
# We emit the health_changed signal every time the
|
||||
# character takes damage
|
||||
emit_signal(health_changed", old_health, health)
|
||||
emit_signal("health_changed", old_health, health)
|
||||
...
|
||||
|
||||
::
|
||||
@@ -1620,7 +1620,7 @@ Our ``BattleLog`` node receives each element in the binds array as an extra argu
|
||||
func _on_Character_health_changed(old_value, new_value, character_name):
|
||||
if not new_value <= old_value:
|
||||
return
|
||||
var damage = new_value - old_value
|
||||
var damage = old_value - new_value
|
||||
label.text += character_name + " took " + str(damage) + " damage."
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user