fixed up pipe hitboxes on smaller characters + piranha plant rotation

This commit is contained in:
JHDev2006
2025-10-01 16:16:06 +01:00
parent 8fbfbd84bf
commit 88fc0f8075
5 changed files with 49 additions and 59 deletions

View File

@@ -184,9 +184,14 @@ _data = {
[sub_resource type="GDScript" id="GDScript_ofvpu"]
script/source = "extends Node
@onready var starting_position: Vector2 = owner.global_position
func _process(_delta: float) -> void:
const OFFSETS = [Vector2.ZERO, Vector2.ZERO, Vector2(-16, 0), Vector2(16, 0)]
if Global.level_editor != null:
owner.global_rotation_degrees = [0, 180, 90, -90][owner.pipe_direction]
owner.global_rotation_degrees = [0, 180, 90, -90][owner.plant_direction]
var offset = OFFSETS[owner.plant_direction]
owner.global_position = starting_position + offset
"
[node name="PirannhaPlant" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
@@ -290,7 +295,7 @@ metadata/_custom_type_script = "uid://ba18grqjixded"
[node name="EditorPropertyExposer" type="Node" parent="."]
script = ExtResource("12_ofvpu")
properties = Array[String](["pipe_direction"])
properties = Array[String](["plant_direction"])
metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
[node name="Node" type="Node" parent="."]

View File

@@ -292,11 +292,11 @@ _data = {
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nbkfn"]
resource_local_to_scene = true
size = Vector2(9, 14)
size = Vector2(9.2, 14)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_d20nf"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vijl6"]
resource_local_to_scene = true
size = Vector2(9, 29.5)
size = Vector2(9.2, 29.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f6bau"]
resource_local_to_scene = true
@@ -498,7 +498,6 @@ collision_mask = 3
collision_priority = 10000000.0
slide_on_ceiling = false
floor_constant_speed = true
floor_max_angle = 0.872665
floor_snap_length = 4.0
platform_on_leave = 2
script = ExtResource("1_f6bau")
@@ -668,7 +667,6 @@ editor_draw_limits = true
editor_draw_drag_margin = true
[node name="Hitbox" type="Area2D" parent="."]
visible = false
position = Vector2(0, -10)
collision_mask = 5
@@ -681,7 +679,7 @@ offset = Vector2(0, -10)
[node name="BigShape" type="CollisionShape2D" parent="Hitbox" groups=["BigCollisions"]]
position = Vector2(0, -4.75)
shape = SubResource("RectangleShape2D_d20nf")
shape = SubResource("RectangleShape2D_vijl6")
disabled = true
debug_color = Color(1, 0, 0, 0.419608)
script = ExtResource("21_jl70t")