implement correct behavior of Max Health attribute of Player
parent
cfd33f791c
commit
e6366f8fea
|
@ -14,7 +14,7 @@ script = ExtResource( 2 )
|
||||||
max_health = 90
|
max_health = 90
|
||||||
|
|
||||||
[node name="Hand" parent="Camera" index="0"]
|
[node name="Hand" parent="Camera" index="0"]
|
||||||
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.399939, -0.559 )
|
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.395602, -0.559 )
|
||||||
|
|
||||||
[node name="WeaponBobAnimationTree" parent="Camera/Hand" index="0"]
|
[node name="WeaponBobAnimationTree" parent="Camera/Hand" index="0"]
|
||||||
parameters/playback = SubResource( 1 )
|
parameters/playback = SubResource( 1 )
|
||||||
|
|
|
@ -309,7 +309,7 @@ master func kill():
|
||||||
|
|
||||||
func spawn():
|
func spawn():
|
||||||
is_dead = false
|
is_dead = false
|
||||||
set_health(150)
|
set_health(max_health)
|
||||||
|
|
||||||
velocity = Vector3()
|
velocity = Vector3()
|
||||||
|
|
||||||
|
@ -383,6 +383,8 @@ func set_local_player():
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
|
$HUD/Health/HealthBar.max_value = max_health
|
||||||
|
|
||||||
# Set player class
|
# Set player class
|
||||||
var path = get_script().get_path()
|
var path = get_script().get_path()
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ script = ExtResource( 8 )
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.53592, -0.0651628 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.53592, -0.0651628 )
|
||||||
|
|
||||||
[node name="Hand" type="Spatial" parent="Camera"]
|
[node name="Hand" type="Spatial" parent="Camera"]
|
||||||
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.399017, -0.559 )
|
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.335, -0.390011, -0.559 )
|
||||||
|
|
||||||
[node name="WeaponBobAnimationTree" type="AnimationTree" parent="Camera/Hand"]
|
[node name="WeaponBobAnimationTree" type="AnimationTree" parent="Camera/Hand"]
|
||||||
tree_root = SubResource( 12 )
|
tree_root = SubResource( 12 )
|
||||||
|
|
|
@ -22,8 +22,7 @@ __meta__ = {
|
||||||
margin_right = 150.0
|
margin_right = 150.0
|
||||||
margin_bottom = 50.0
|
margin_bottom = 50.0
|
||||||
rect_min_size = Vector2( 150, 50 )
|
rect_min_size = Vector2( 150, 50 )
|
||||||
max_value = 150.0
|
value = 100.0
|
||||||
value = 150.0
|
|
||||||
texture_under = ExtResource( 3 )
|
texture_under = ExtResource( 3 )
|
||||||
texture_over = ExtResource( 2 )
|
texture_over = ExtResource( 2 )
|
||||||
texture_progress = ExtResource( 1 )
|
texture_progress = ExtResource( 1 )
|
||||||
|
|
Reference in New Issue