diff --git a/game/player/Mob.tscn b/game/player/Mob.tscn index 091bb53..48f535c 100644 --- a/game/player/Mob.tscn +++ b/game/player/Mob.tscn @@ -14,11 +14,11 @@ body_path = NodePath("KinematicBody2D") character_skeleton_path = NodePath("KinematicBody2D/Character") script = ExtResource( 2 ) +[node name="NamePlate" parent="." instance=ExtResource( 3 )] + [node name="KinematicBody2D" type="KinematicBody2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="KinematicBody2D"] shape = SubResource( 1 ) [node name="Character" parent="KinematicBody2D" instance=ExtResource( 1 )] - -[node name="NamePlate" parent="KinematicBody2D" instance=ExtResource( 3 )] diff --git a/game/player/NamePlate.gd b/game/player/NamePlate.gd index ef71654..405527b 100644 --- a/game/player/NamePlate.gd +++ b/game/player/NamePlate.gd @@ -51,7 +51,7 @@ func _ready(): health_bar = get_node(health_bar_path) as TextureProgress health_bar_label = get_node(health_bar_label_path) as Label - entity = get_node("../..") as Entity + entity = get_node("..") as Entity health = entity.get_health() health.connect("c_changed", self, "c_health_changed") @@ -77,19 +77,17 @@ func _ready(): func _process(delta): if interpolating: var d : Vector2 = ((target_scale - get_scale()).normalized() * delta) + get_scale() - + set_scale(d) - + if (get_scale() - target_scale).length() < 0.04: interpolating = false var position : Vector2 = entity.get_body().position - position = get_global_transform().xform_inv(position) - - position.x -= (rect_size.x / 2.0 + 24) * rect_scale.x - position.y -= 130 * rect_scale.y + position.x -= (rect_size.x / 2.0) * rect_scale.x + position.y -= 60 set_position(position) diff --git a/game/scenes/World.tscn b/game/scenes/World.tscn index 8a71517..731530c 100644 --- a/game/scenes/World.tscn +++ b/game/scenes/World.tscn @@ -11,6 +11,7 @@ script = ExtResource( 1 ) world_layer = ExtResource( 2 ) [node name="Terrarin" type="TileMap" parent="."] +z_index = -10 tile_set = ExtResource( 3 ) cell_size = Vector2( 32, 32 ) format = 1