Update hitboxes for consistency (#608)

Co-authored-by: Joe H <97353363+JHDev2006@users.noreply.github.com>
This commit is contained in:
John Cooper McDonald
2025-10-17 11:12:57 -05:00
committed by GitHub
parent ed297891fd
commit 9a17f140e0
27 changed files with 246 additions and 209 deletions

View File

@@ -1,14 +1,12 @@
[gd_scene load_steps=16 format=3 uid="uid://rruc6lnk16rr"]
[gd_scene load_steps=14 format=3 uid="uid://rruc6lnk16rr"]
[ext_resource type="Script" uid="uid://dryofl8epgget" path="res://Scripts/Classes/Entities/Items/ClockItem.gd" id="1_heiyr"]
[ext_resource type="Texture2D" uid="uid://dal8md4ms07j2" path="res://Assets/Sprites/Items/Clock.png" id="1_ybxan"]
[ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_heiyr"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_ov4xw"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/Clock.json" id="4_newwu"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="5_fg0gx"]
[ext_resource type="Script" uid="uid://dt2p68xl462v2" path="res://Scripts/Parts/TextShadowColourChanger.gd" id="6_ggci8"]
[ext_resource type="Script" uid="uid://co6tjg3w6qpd8" path="res://Scripts/Parts/LabelFontChanger.gd" id="7_eol0e"]
[ext_resource type="Resource" uid="uid://8dcuxbc3h2u2" path="res://Resources/ThemedResources/Font.tres" id="8_34q7a"]
[sub_resource type="AtlasTexture" id="AtlasTexture_c30tx"]
atlas = ExtResource("1_ybxan")
@@ -136,8 +134,6 @@ resource_json = ExtResource("4_newwu")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="Hitbox" type="Area2D" parent="Sprite"]
script = ExtResource("5_fg0gx")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/Hitbox"]
shape = SubResource("RectangleShape2D_ydslq")
@@ -160,7 +156,6 @@ metadata/_custom_type_script = "uid://dt2p68xl462v2"
[node name="LabelFontChanger" type="Node" parent="Label" node_paths=PackedStringArray("labels")]
script = ExtResource("7_eol0e")
labels = [NodePath("..")]
resource = ExtResource("8_34q7a")
metadata/_custom_type_script = "uid://co6tjg3w6qpd8"
[node name="AnimationPlayer" type="AnimationPlayer" parent="Label"]
@@ -168,4 +163,4 @@ libraries = {
&"": SubResource("AnimationLibrary_ov4xw")
}
[connection signal="player_entered" from="Sprite/Hitbox" to="." method="collect_item"]
[connection signal="area_entered" from="Sprite/Hitbox" to="." method="on_area_entered"]

View File

@@ -1,22 +1,21 @@
[gd_scene load_steps=10 format=3 uid="uid://dn2rawqxpuywe"]
[gd_scene load_steps=9 format=3 uid="uid://dn2rawqxpuywe"]
[ext_resource type="Script" uid="uid://bb01xttxcem1c" path="res://Scripts/Classes/Entities/Items/Hachisuke.gd" id="1_d7uck"]
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_wdqsg"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_3unjp"]
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="3_eh4yc"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="4_3unjp"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/Hachisuke.json" id="4_db2kr"]
[sub_resource type="AtlasTexture" id="AtlasTexture_qj4fn"]
atlas = ExtResource("2_wdqsg")
region = Rect2(0, 0, 16, 16)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kn7db"]
size = Vector2(12, 12)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6c253"]
size = Vector2(16, 16)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8f4k7"]
size = Vector2(12, 12)
[node name="Hachisuke" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 6
@@ -40,18 +39,14 @@ script = ExtResource("3_eh4yc")
add_score = true
metadata/_custom_type_script = "uid://5octqlf4ohel"
[node name="PlayerDetection" type="Area2D" parent="."]
position = Vector2(0, -8)
script = ExtResource("4_3unjp")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="Shape" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("RectangleShape2D_kn7db")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -8)
shape = SubResource("RectangleShape2D_6c253")
[connection signal="player_entered" from="PlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [8000]]
[connection signal="player_entered" from="PlayerDetection" to="." method="play_sfx" unbinds=1]
[connection signal="player_entered" from="PlayerDetection" to="." method="queue_free" unbinds=1]
[node name="Hitbox" type="Area2D" parent="."]
position = Vector2(0, -8)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_8f4k7")
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=10 format=3 uid="uid://deo08vl26nc4b"]
[gd_scene load_steps=11 format=3 uid="uid://hqrc7ujinbcq"]
[ext_resource type="Script" uid="uid://s1utdly4mtbi" path="res://Scripts/Classes/Entities/Items/Hammer.gd" id="1_3ojke"]
[ext_resource type="Texture2D" uid="uid://3xmhfi556p3s" path="res://Assets/Sprites/Items/Hammer.png" id="1_o34jf"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_k3c6x"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/Hammer.json" id="4_pmlpp"]
[ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="5_pmlpp"]
[sub_resource type="AtlasTexture" id="AtlasTexture_2tvg3"]
atlas = ExtResource("1_o34jf")
@@ -51,17 +52,17 @@ _data = {
[sub_resource type="CircleShape2D" id="CircleShape2D_pmlpp"]
radius = 4.0
[node name="Hammer" type="Node2D" groups=["Enemies"]]
[node name="Hammer" type="CharacterBody2D" groups=["Enemies"]]
script = ExtResource("1_3ojke")
metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
[node name="Sprite" type="Sprite2D" parent="."]
physics_interpolation_mode = 2
texture = SubResource("AtlasTexture_2tvg3")
[node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect", "property_node")]
[node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
script = ExtResource("3_k3c6x")
node_to_affect = NodePath("..")
property_node = NodePath("../..")
property_name = "texture"
mode = 1
resource_json = ExtResource("4_pmlpp")
@@ -78,4 +79,9 @@ autoplay = "Rotate"
[node name="Shape" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("CircleShape2D_pmlpp")
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
[node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("5_pmlpp")
hitbox = NodePath("../Hitbox")
[connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
[connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]

View File

@@ -1,31 +1,22 @@
[gd_scene load_steps=8 format=3 uid="uid://bwdwavf4rp1m1"]
[gd_scene load_steps=7 format=3 uid="uid://bwdwavf4rp1m1"]
[ext_resource type="Script" uid="uid://vhxup1pn2v8q" path="res://Scripts/Classes/Entities/Items/HammerItem.gd" id="1_ws752"]
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_c0srl"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_uc7h7"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_uc7h7"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/HammerItem.json" id="5_6qq3q"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ws752"]
size = Vector2(8, 8)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uc7h7"]
size = Vector2(10, 10)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ws752"]
size = Vector2(12, 12)
[node name="HammerItem" type="CharacterBody2D"]
collision_layer = 8
collision_mask = 2
script = ExtResource("1_ws752")
metadata/_custom_type_script = "uid://cjkurwybsaywm"
[node name="Hitbox" type="Area2D" parent="."]
script = ExtResource("3_uc7h7")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="Shape" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(0, -8)
shape = SubResource("RectangleShape2D_ws752")
[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(0, -8)
texture = ExtResource("2_c0srl")
@@ -44,4 +35,10 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
position = Vector2(0, -5)
shape = SubResource("RectangleShape2D_uc7h7")
[connection signal="player_entered" from="Hitbox" to="." method="on_player_entered"]
[node name="Hitbox" type="Area2D" parent="."]
position = Vector2(0, -8)
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_ws752")
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=18 format=3 uid="uid://ny5glffi0suh"]
[gd_scene load_steps=17 format=3 uid="uid://ny5glffi0suh"]
[ext_resource type="Texture2D" uid="uid://bagrao4ahra76" path="res://Assets/Sprites/Items/Key.png" id="1_883rn"]
[ext_resource type="Script" uid="uid://cjgbt7iof66j0" path="res://Scripts/Classes/Entities/Items/KeyItem.gd" id="1_l02ex"]
[ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_ecusj"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_l02ex"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_m8uts"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/Key.json" id="4_m8uts"]
[ext_resource type="Texture2D" uid="uid://sgrcmlktp2dk" path="res://Assets/Sprites/Particles/SRankParticles.png" id="7_2yl70"]
@@ -146,8 +145,6 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="Hitbox" type="Area2D" parent="."]
position = Vector2(0, -8)
script = ExtResource("3_m8uts")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_2u37r")
@@ -165,3 +162,5 @@ amount = 1
texture = ExtResource("7_2yl70")
randomness = 0.12
process_material = SubResource("ParticleProcessMaterial_rls2x")
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]

View File

@@ -1,18 +1,18 @@
[gd_scene load_steps=11 format=3 uid="uid://dhd0gp2xvl53l"]
[gd_scene load_steps=10 format=3 uid="uid://dhd0gp2xvl53l"]
[ext_resource type="Script" uid="uid://bafdl3y53ly60" path="res://Scripts/Classes/UI/PackAnimatedSprite2D.gd" id="2_724cb"]
[ext_resource type="Texture2D" uid="uid://bbdcmhyxmc3pu" path="res://Assets/Sprites/Items/SPItems.png" id="2_wnlnm"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_724cb"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_ke2o5"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/LuckyStar.json" id="4_4cwfa"]
[sub_resource type="GDScript" id="GDScript_y0edb"]
script/source = "extends PowerUpItem
func player_entered(_player: Player) -> void:
queue_free()
AudioManager.play_global_sfx(\"lucky_star\")
get_tree().call_group(\"Enemies\", \"flag_die\")
func on_area_entered(area: Area2D) -> void:
if area.owner is Player:
queue_free()
AudioManager.play_global_sfx(\"lucky_star\")
get_tree().call_group(\"Enemies\", \"flag_die\")
"
[sub_resource type="AtlasTexture" id="AtlasTexture_ke2o5"]
@@ -59,12 +59,10 @@ property_name = "sprite_frames"
resource_json = ExtResource("4_4cwfa")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="PlayerDetection" type="Area2D" parent="."]
[node name="Hitbox" type="Area2D" parent="."]
position = Vector2(0, -8)
script = ExtResource("3_724cb")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("RectangleShape2D_7yv5x")
[connection signal="player_entered" from="PlayerDetection" to="." method="player_entered"]
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=18 format=3 uid="uid://cmbpqnq10arts"]
[gd_scene load_steps=17 format=3 uid="uid://cmbpqnq10arts"]
[ext_resource type="Script" uid="uid://xwq5ac650e76" path="res://Scripts/Classes/Entities/Items/RedCoin.gd" id="1_c6tmk"]
[ext_resource type="Texture2D" uid="uid://c8wpxm7b5tgiq" path="res://Assets/Sprites/Items/RedCoin.png" id="2_lwdcj"]
[ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_0r8d3"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_0xloa"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_onh0k"]
[ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="4_lwdcj"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/RedCoin.json" id="5_0fjrw"]
@@ -103,8 +102,6 @@ metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="Hitbox" type="Area2D" parent="."]
collision_mask = 5
script = ExtResource("3_onh0k")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="Shape" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(0, 1.5)
@@ -113,8 +110,8 @@ shape = SubResource("RectangleShape2D_4qu2r")
[node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
script = ExtResource("4_lwdcj")
detection_type = 1
hitbox = NodePath("../Hitbox")
hitbox = NodePath("")
metadata/_custom_type_script = "uid://cmg61722ktg2m"
[connection signal="player_entered" from="Hitbox" to="." method="on_player_entered"]
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
[connection signal="block_bounced" from="BlockBouncingDetection" to="." method="summon_bounced_coin" unbinds=1]

View File

@@ -1,8 +1,7 @@
[gd_scene load_steps=10 format=3 uid="uid://ck0spcws71sg5"]
[gd_scene load_steps=9 format=3 uid="uid://ck0spcws71sg5"]
[ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="1_fcvyr"]
[ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_gjj3y"]
[ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="2_neobf"]
[ext_resource type="JSON" path="res://Assets/Sprites/Items/WingItem.json" id="3_1uenh"]
[ext_resource type="Script" uid="uid://bx6r8sjar6cwr" path="res://Scripts/Classes/Components/BasicStaticMovement.gd" id="3_143ya"]
[ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="4_gdso8"]
@@ -10,10 +9,13 @@
[sub_resource type="GDScript" id="GDScript_gdso8"]
script/source = "extends PowerUpItem
func player_entered(player: Player) -> void:
AudioManager.play_sfx(\"power_up\", global_position)
player.wing_get()
queue_free()
func on_area_entered(area: Area2D) -> void:
if area.owner is Player:
AudioManager.play_sfx(\"power_up\", global_position)
Global.score += 1000
$ScoreNoteSpawner.spawn_note(1000)
area.owner.wing_get()
queue_free()
"
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fcvyr"]
@@ -42,8 +44,6 @@ resource_json = ExtResource("3_1uenh")
metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
[node name="Hitbox" type="Area2D" parent="."]
script = ExtResource("2_neobf")
metadata/_custom_type_script = "uid://cnheej0sxmoxg"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(0, -8)
@@ -62,5 +62,4 @@ script = ExtResource("4_gdso8")
add_score = true
metadata/_custom_type_script = "uid://5octqlf4ohel"
[connection signal="player_entered" from="Hitbox" to="." method="player_entered"]
[connection signal="player_entered" from="Hitbox" to="ScoreNoteSpawner" method="spawn_note" binds= [1000]]
[connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]