fixed explosion calculation and finished cards + xp bar

better-perk-display
Artur 2026-04-15 17:22:15 +02:00
parent 681471259b
commit 452325a0b4
5 changed files with 40 additions and 2 deletions

View File

@ -17,6 +17,7 @@
[ext_resource type="Script" uid="uid://ckv6prbe1o7s1" path="res://scripts/drop_manager.gd" id="10_vtaks"]
[ext_resource type="Script" uid="uid://pmmc7tivuuo4" path="res://scripts/perk_effects.gd" id="16_ca42v"]
[ext_resource type="Script" uid="uid://dm1sntwjrv3vl" path="res://scripts/level_up_manager.gd" id="16_rysoc"]
[ext_resource type="Texture2D" uid="uid://dp8o40ssuh8ip" path="res://assets/Tiny RPG Mana Soul GUI v1.0/20250421barB-Sheet.png" id="16_ssvqc"]
[sub_resource type="Resource" id="Resource_ssvqc"]
script = ExtResource("6_ir15t")
@ -2417,6 +2418,26 @@ max_value = 5.0
step = 1.0
show_percentage = false
[node name="NinePatchRect" type="NinePatchRect" parent="CanvasLayer/ProgressBar" unique_id=1364517669]
texture_filter = 1
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -6.5
offset_top = -1.0
offset_right = 5.5
offset_bottom = 2.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("16_ssvqc")
draw_center = false
region_rect = Rect2(0, 0, 95, 15)
patch_margin_left = 7
patch_margin_top = 5
patch_margin_right = 8
patch_margin_bottom = 6
[node name="LevelUpManager" type="Control" parent="CanvasLayer" unique_id=292400493]
process_mode = 3
layout_mode = 3
@ -2426,6 +2447,14 @@ anchor_right = 0.5
grow_horizontal = 2
script = ExtResource("16_rysoc")
[node name="ColorRect" type="ColorRect" parent="CanvasLayer/LevelUpManager" unique_id=1319513730]
layout_mode = 1
offset_left = -656.0
offset_top = -9.0
offset_right = 642.0
offset_bottom = 728.0
color = Color(0, 0, 0, 0.0627451)
[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/LevelUpManager" unique_id=957625333]
custom_minimum_size = Vector2(1000, 400)
layout_mode = 1

View File

@ -3,6 +3,7 @@ extends Area2D
# Called when the node enters the scene tree for the first time.
func _ready():
await get_tree().physics_frame
for body in get_overlapping_bodies():
if body.is_in_group("enemies"):
body.hit()

View File

@ -10,6 +10,6 @@ func _on_body_entered(body: Node2D) -> void:
if fireball_aoe:
var boom = explosion_scene.instantiate()
boom.global_position = global_position
get_parent().add_child(boom)
get_parent().call_deferred("add_child", boom)
queue_free()

View File

@ -2,6 +2,7 @@ extends Control
@onready var perk_effects = get_node("/root/Game/PerkEffects")
var perks
@onready var perkCard = preload("res://scenes/PerkCard.tscn")
# Called when the node enters the scene tree for the first time.
@ -18,6 +19,8 @@ func _process(delta: float) -> void:
func show_perks():
if perks.is_empty():
return
var tween = create_tween()
tween.tween_property($ColorRect, "color:a", 0.6, 0.3)
get_tree().paused = true
var shuffled = perks.duplicate()
shuffled.shuffle()
@ -33,3 +36,6 @@ func select_perk(perk):
get_tree().paused = false
perks.erase(perk)
for child in $HBoxContainer.get_children(): child.queue_free()
var tween = create_tween()
tween.tween_property($ColorRect, "color:a", 0.0, 0.3)
await tween.finished

View File

@ -12,8 +12,10 @@ func setup(perk: Perk, select: Callable):
if perk.icon != null:
$Card/Name/TextureRect.texture = perk.icon
animate_in()
$Button.modulate.a = 0.3
$Button.mouse_entered.connect(func(): $Button.modulate.a = 0.6)
$Button.mouse_exited.connect(func(): $Button.modulate.a = 0.3)
on_select = select
$Button.pressed.connect(_on_button_pressed)