magnetic skill

This commit is contained in:
2025-02-16 23:28:07 +01:00
parent 9b11189905
commit 57930f1c50
4 changed files with 83 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://bqi5s710xb1ju"]
[gd_scene load_steps=19 format=3 uid="uid://bqi5s710xb1ju"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_8j4h4"]
[ext_resource type="Texture2D" uid="uid://b7gp0gqvkv8j4" path="res://sprites/MrBrick_base.png" id="2_bc55y"]
@@ -14,6 +14,7 @@
[ext_resource type="Script" path="res://scripts/components/stomp_damage_component.gd" id="12_payr4"]
[ext_resource type="Script" path="res://scripts/components/flashing_component.gd" id="13_hrtyn"]
[ext_resource type="Script" path="res://scripts/components/invulnerability_component.gd" id="14_jopig"]
[ext_resource type="Script" path="res://scripts/components/magnetic_skill.gd" id="15_4df3h"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hdsg1"]
size = Vector2(16, 31)
@@ -21,6 +22,9 @@ size = Vector2(16, 31)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vad0t"]
size = Vector2(16, 32)
[sub_resource type="CircleShape2D" id="CircleShape2D_ps31c"]
radius = 48.0
[node name="Brick Player" type="CharacterBody2D"]
collision_layer = 4
collision_mask = 11
@@ -115,5 +119,18 @@ health_component = NodePath("../HealthComponent")
script = ExtResource("14_jopig")
flashing_component = NodePath("../FlashingComponent Base")
[node name="MagneticSkillComponent" type="Node" parent="." node_paths=PackedStringArray("magnetic_area", "root")]
script = ExtResource("15_4df3h")
magnetic_area = NodePath("../MagneticArea")
root = NodePath("..")
magnetic_move_duration = 0.9
[node name="MagneticArea" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="MagneticArea"]
shape = SubResource("CircleShape2D_ps31c")
[connection signal="on_death" from="HealthComponent" to="PlayerDeathComponent" method="_on_health_component_on_death"]
[connection signal="on_health_change" from="HealthComponent" to="KnockbackComponent" method="_on_health_component_on_health_change"]