new start with sprites and instantiation

This commit is contained in:
tonydero 2024-10-03 06:45:13 -06:00
parent da2b76eaff
commit 2fc30ef3f6
9 changed files with 366 additions and 122 deletions

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>

Before

Width:  |  Height:  |  Size: 994 B

View File

@ -1,37 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b10c1776j6j60"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View File

@ -11,9 +11,9 @@ config_version=5
[application]
config/name="Semi-Idle ARPG"
run/main_scene="res://scenes/testScene.tscn"
run/main_scene="res://scenes/testInstanceScene.tscn"
config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://icon.svg"
config/icon="res://assets/icon.svg"
[display]

View File

@ -1,56 +1,58 @@
[gd_scene load_steps=2 format=3 uid="uid://ba27ufs8eak0b"]
[gd_scene load_steps=4 format=3 uid="uid://dkmnvye1y33d7"]
[ext_resource type="Texture2D" uid="uid://b10c1776j6j60" path="res://assets/icon.svg" id="2_6hwax"]
[ext_resource type="Script" path="res://scripts/character.gd" id="2_bft53"]
[node name="Character" type="Control"]
layout_mode = 3
anchors_preset = 0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tv6kf"]
size = Vector2(196, 175)
[node name="Character" type="Node2D"]
script = ExtResource("2_bft53")
[node name="CharacterPanel" type="PanelContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 567.0
offset_top = 300.0
offset_right = 675.0
offset_bottom = 350.0
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
position = Vector2(0, -11.5)
shape = SubResource("RectangleShape2D_tv6kf")
[node name="Sprite2D" type="Sprite2D" parent="CharacterBody2D"]
texture = ExtResource("2_6hwax")
[node name="MarginContainer" type="MarginContainer" parent="CharacterBody2D/Sprite2D"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -91.0
offset_top = -94.0
offset_right = -36.0
offset_bottom = -57.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
[node name="VBoxContainer" type="VBoxContainer" parent="CharacterPanel"]
[node name="Nameplate" type="VBoxContainer" parent="CharacterBody2D/Sprite2D/MarginContainer"]
layout_mode = 2
[node name="Healthbar" type="ProgressBar" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate"]
custom_minimum_size = Vector2(0, 16)
layout_mode = 2
max_value = 10.0
step = 1.0
value = 10.0
show_percentage = false
[node name="TitleBox" type="HBoxContainer" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate"]
layout_mode = 2
[node name="TierLabel" type="Label" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate/TitleBox"]
layout_mode = 2
size_flags_horizontal = 4
[node name="CharacterName" type="Label" parent="CharacterPanel/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
text = "Name"
horizontal_alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="CharacterPanel/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
[node name="CharacterCurrHealth" type="Label" parent="CharacterPanel/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
text = "Current"
[node name="CharacterHealthSep" type="Label" parent="CharacterPanel/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "/"
[node name="CharacterMaxHealth" type="Label" parent="CharacterPanel/VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
text = "Max
size_flags_vertical = 0
text = "Tier
"
[node name="NameLabel" type="Label" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate/TitleBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
text = "Name"

View File

@ -1,12 +1,58 @@
[gd_scene load_steps=2 format=3 uid="uid://cdu3sqa0k8dgs"]
[gd_scene load_steps=4 format=3 uid="uid://cdu3sqa0k8dgs"]
[ext_resource type="Script" path="res://scripts/npc.gd" id="2_a7mo0"]
[ext_resource type="Texture2D" uid="uid://b10c1776j6j60" path="res://assets/icon.svg" id="2_yarwk"]
[node name="NPC" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_left = 669.0
offset_top = 330.0
offset_right = 669.0
offset_bottom = 330.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tv6kf"]
size = Vector2(196, 175)
[node name="NPC" type="Node2D"]
script = ExtResource("2_a7mo0")
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
position = Vector2(0, -11.5)
shape = SubResource("RectangleShape2D_tv6kf")
[node name="Sprite2D" type="Sprite2D" parent="CharacterBody2D"]
texture = ExtResource("2_yarwk")
[node name="MarginContainer" type="MarginContainer" parent="CharacterBody2D/Sprite2D"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -91.0
offset_top = -94.0
offset_right = -36.0
offset_bottom = -57.0
grow_horizontal = 2
grow_vertical = 2
[node name="Nameplate" type="VBoxContainer" parent="CharacterBody2D/Sprite2D/MarginContainer"]
layout_mode = 2
[node name="Healthbar" type="ProgressBar" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate"]
custom_minimum_size = Vector2(0, 16)
layout_mode = 2
max_value = 10.0
step = 1.0
value = 10.0
show_percentage = false
[node name="TitleBox" type="HBoxContainer" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate"]
layout_mode = 2
[node name="TierLabel" type="Label" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate/TitleBox"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
text = "Tier
"
[node name="NPCNameLabel" type="Label" parent="CharacterBody2D/Sprite2D/MarginContainer/Nameplate/TitleBox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 0
text = "Name"

View File

@ -3,10 +3,10 @@
[ext_resource type="Script" path="res://scripts/test_scene.gd" id="1_mj8nf"]
[ext_resource type="Script" path="res://scripts/styling.gd" id="2_8602c"]
[sub_resource type="LabelSettings" id="LabelSettings_hep25"]
[sub_resource type="LabelSettings" id="LabelSettings_ppp5s"]
[sub_resource type="LabelSettings" id="LabelSettings_hep25"]
[node name="TestScene" type="Control"]
layout_mode = 3
anchors_preset = 15
@ -17,9 +17,18 @@ grow_vertical = 2
script = ExtResource("1_mj8nf")
[node name="Styling" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_8602c")
[node name="MarginContainer" type="MarginContainer" parent="."]
@ -37,49 +46,269 @@ theme_override_constants/margin_bottom = 10
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2
[node name="TestNMEContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer"]
[node name="NMEDisplayArea" type="VBoxContainer" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="BossNameplate" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 6
[node name="TestNMEValBox" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TestNMEContainer"]
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 6
[node name="TestNMELabels" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TestNMEContainer/TestNMEValBox"]
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate/NMETitleContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/TestNMEContainer/TestNMEValBox/TestNMELabels"]
unique_name_in_owner = true
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate/NMETitleContainer"]
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
horizontal_alignment = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/TestNMEContainer/TestNMEValBox/TestNMELabels"]
[node name="BossHealthbar" type="TextureProgressBar" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate"]
layout_mode = 2
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEVals" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TestNMEContainer/TestNMEValBox"]
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/BossNameplate/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
size_flags_vertical = 3
text = "Value"
label_settings = SubResource("LabelSettings_ppp5s")
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/TestNMEContainer/TestNMEValBox/TestNMEVals"]
[node name="NMENormalArea" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea"]
layout_mode = 2
[node name="NMENameplate" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate"]
layout_mode = 2
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate/NMETitleContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate/NMETitleContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate/NMEHealthContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
text = "Value"
label_settings = SubResource("LabelSettings_ppp5s")
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/TestNMEContainer/TestNMEValBox/TestNMEVals"]
unique_name_in_owner = true
[node name="NMENameplate2" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate2"]
layout_mode = 2
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate2/NMETitleContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate2/NMETitleContainer"]
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate2"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate2/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate2/NMEHealthContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Value"
label_settings = SubResource("LabelSettings_ppp5s")
[node name="NMENameplate3" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate3"]
layout_mode = 2
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate3/NMETitleContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate3/NMETitleContainer"]
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate3"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate3/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate3/NMEHealthContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Value"
label_settings = SubResource("LabelSettings_ppp5s")
[node name="NMENameplate4" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate4"]
layout_mode = 2
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate4/NMETitleContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate4/NMETitleContainer"]
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate4"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate4/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate4/NMEHealthContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Value"
label_settings = SubResource("LabelSettings_ppp5s")
[node name="NMENameplate5" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate5"]
layout_mode = 2
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate5/NMETitleContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate5/NMETitleContainer"]
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate5"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate5/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMENormalArea/NMENameplate5/NMEHealthContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Value"
label_settings = SubResource("LabelSettings_ppp5s")
[node name="NMEMinionArea" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea"]
layout_mode = 2
size_flags_horizontal = 4
[node name="NMENameplate" type="VBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 6
[node name="NMETitleContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea/NMENameplate"]
layout_mode = 2
[node name="TestNMETierVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea/NMENameplate/NMETitleContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Tier"
label_settings = SubResource("LabelSettings_ppp5s")
horizontal_alignment = 2
[node name="TestNMEName" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea/NMENameplate/NMETitleContainer"]
layout_mode = 2
text = "Name
"
label_settings = SubResource("LabelSettings_hep25")
[node name="NMEHealthContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea/NMENameplate"]
layout_mode = 2
[node name="TestNMEMaxHealth" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea/NMENameplate/NMEHealthContainer"]
layout_mode = 2
size_flags_horizontal = 8
text = "Max Health:"
horizontal_alignment = 2
[node name="TestNMEMaxHealthVal" type="Label" parent="MarginContainer/VBoxContainer/NMEDisplayArea/NMEMinionArea/NMENameplate/NMEHealthContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Value"

View File

@ -1,5 +1,5 @@
class_name Character
extends Control
extends Node2D
@export var charName := "Character"
@ -7,6 +7,7 @@ extends Control
@export var dmgTaken := 0
func _init() -> void:
%CharacterName.text = self.charName
%CharacterMaxHealth.text = str(self.maxHealth)
%CharacterCurrHealth.text = str(self.maxHealth - self.dmgTaken)
pass
#%NameLabel.text = self.charName
#%CharacterMaxHealth.text = str(self.maxHealth)
#%CharacterCurrHealth.text = str(self.maxHealth - self.dmgTaken)

View File

@ -2,7 +2,7 @@ class_name NPC
extends Character
enum npcDifficulties { MINION, NORMAL, MINIBOSS, BOSS, ELITEBOSS, BBEG }
enum npcDifficulties { MINION, NORMAL, ELITE, BOSS, ELITEBOSS, BBEG }
enum npcTiers { I, II, III, IV, V, VI, VII, VIII, IX, X }
@export var npcDifficulty: npcDifficulties
@ -17,7 +17,7 @@ func _random_mod_health() -> void:
match self.npcDifficulty:
npcDifficulties.MINION:
self.maxHealth /= 2
npcDifficulties.MINIBOSS:
npcDifficulties.ELITE:
self.maxHealth *= 2
npcDifficulties.BOSS:
self.maxHealth *= 4

View File

@ -1,6 +1,9 @@
extends Control
@onready var styling: Control = $Styling
func _on_exit_button_pressed() -> void:
get_tree().quit()
@ -13,6 +16,7 @@ func _on_test_button_pressed() -> void:
#TestEMaxHealthVal.label_settings = LabelSettings.new()
%TestNMEName.text = str(NPC.npcDifficulties.find_key(anNPC.npcDifficulty))
%TestNMETierVal.text = str(NPC.npcTiers.find_key(anNPC.npcTier))
$Styling.format_label_difficulty(%TestNMEName, anNPC.npcDifficulty)
# style the name label based on the difficulty
styling.format_label_difficulty(%TestNMEName, anNPC.npcDifficulty)
#anNPC.position = Vector2(64, 64)
#add_child(anNPC)