SlimePlatformer/Characters/player.tscn
SnekInAScarf 31f1de7d68 Halve edgeSensorRange to 12 so edge wraps need the slime at the edge
Pressing into a surface now only wraps around its edge when the slime's
center is within 12px of it, i.e. the slime is touching the edge (about
1px gap), instead of up to 13px away with the old 24. Walking up to an
edge still always works, since the edge hold stops the slime there.

Measured with a headless sweep of 24/16/14/12/10/8/6/4 on floors,
ceilings and wall bottoms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 15:54:34 -07:00

59 lines
2.2 KiB
Text
Executable file

[gd_scene format=3 uid="uid://uaxviwb40nn8"]
[ext_resource type="Script" uid="uid://drxbt88sjb1y4" path="res://Characters/player.gd" id="1_eovys"]
[ext_resource type="Texture2D" uid="uid://c3v26u2wh4it4" path="res://Assets/Player.png" id="2_eovys"]
[ext_resource type="AudioStream" uid="uid://b06e7ntjhc4dp" path="res://Assets/Sounds/slime_land_1.ogg" id="3_land1"]
[ext_resource type="AudioStream" uid="uid://bpa664tsd4kwn" path="res://Assets/Sounds/slime_land_2.ogg" id="4_land2"]
[ext_resource type="AudioStream" uid="uid://ceyykao0r6u7g" path="res://Assets/Sounds/slime_land_3.ogg" id="5_land3"]
[ext_resource type="AudioStream" uid="uid://1dmf4p7x4y3b" path="res://Assets/Sounds/slime_wrap.ogg" id="6_wrap"]
[sub_resource type="CircleShape2D" id="CircleShape2D_eovys"]
[sub_resource type="Gradient" id="Gradient_splat"]
colors = PackedColorArray(0, 0.6666667, 0, 1, 0, 1, 0.50980395, 1)
[node name="Player" type="CharacterBody2D" unique_id=150873177]
script = ExtResource("1_eovys")
landSounds = Array[AudioStream]([ExtResource("3_land1"), ExtResource("4_land2"), ExtResource("5_land3")])
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1511454314]
texture = ExtResource("2_eovys")
offset = Vector2(0, -6)
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1379572123]
shape = SubResource("CircleShape2D_eovys")
[node name="EdgeSensors" type="Node2D" parent="."]
[node name="LeftEdgeSensor" type="RayCast2D" parent="EdgeSensors"]
position = Vector2(-12, 0)
target_position = Vector2(0, 14)
[node name="RightEdgeSensor" type="RayCast2D" parent="EdgeSensors"]
position = Vector2(12, 0)
target_position = Vector2(0, 14)
[node name="SplatParticles" type="CPUParticles2D" parent="."]
top_level = true
emitting = false
amount = 8
lifetime = 0.4
one_shot = true
explosiveness = 1.0
direction = Vector2(0, -1)
spread = 55.0
gravity = Vector2(0, 500)
initial_velocity_min = 40.0
initial_velocity_max = 90.0
scale_amount_min = 1.0
scale_amount_max = 2.0
color_initial_ramp = SubResource("Gradient_splat")
[node name="LandSound" type="AudioStreamPlayer" parent="."]
volume_db = -6.0
bus = &"SFX"
[node name="WrapSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("6_wrap")
volume_db = -10.0
bus = &"SFX"