Compare commits
8 Commits
feature/le
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
fd64d64adf | |
|
|
ed424fc250 | |
|
|
16c3204375 | |
|
|
a16ab33e4f | |
|
|
a7fbcfe7a6 | |
|
|
ddd50c9d5f | |
|
|
11fc120236 | |
|
|
00bd30e3b4 |
|
|
@ -0,0 +1,9 @@
|
|||
<component name="libraryTable">
|
||||
<library name="GdSdk" type="GdScript">
|
||||
<CLASSES />
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$APPLICATION_HOME_DIR$/plugins/rider-gdscript/sdk/extracted/Master" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<component name="libraryTable">
|
||||
<library name="GdSdk Master" type="GdScript">
|
||||
<properties path="C:\Users\和玲央央\AppData\Local\JetBrains\Rider2024.3\projects\godot-plateformer.a8f64e99\sdk\GdSdk Master" version="Master" date="2024-06-01T15:14:16.000+02:00" />
|
||||
<CLASSES />
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$USER_HOME$/AppData/Local/JetBrains/Rider2024.3/projects/godot-plateformer.a8f64e99/sdk/GdSdk Master" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
Before Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dted7geb331y2"
|
||||
path="res://.godot/imported/character.png-7c44b4524e7faa111c3b7a3476538724.ctex"
|
||||
uid="uid://bryuhk1hqe4hh"
|
||||
path="res://.godot/imported/character01.png-4ae759f7a7c8b54af8e62bf3e502a8de.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://_asset/ksw/character.png"
|
||||
dest_files=["res://.godot/imported/character.png-7c44b4524e7faa111c3b7a3476538724.ctex"]
|
||||
source_file="res://_asset/ksw/character01.png"
|
||||
dest_files=["res://.godot/imported/character01.png-4ae759f7a7c8b54af8e62bf3e502a8de.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
After Width: | Height: | Size: 66 KiB |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cw1lcd672mq87"
|
||||
path="res://.godot/imported/未命名作品(3).png-5152e47ab8192492e0d911592bc8c8f5.ctex"
|
||||
uid="uid://b4k06j8chs2el"
|
||||
path="res://.godot/imported/character02.png-17a0c468b9f208a10603c306ed77416b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://_asset/ksw/未命名作品(3).png"
|
||||
dest_files=["res://.godot/imported/未命名作品(3).png-5152e47ab8192492e0d911592bc8c8f5.ctex"]
|
||||
source_file="res://_asset/ksw/character02.png"
|
||||
dest_files=["res://.godot/imported/character02.png-17a0c468b9f208a10603c306ed77416b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dkip6i0oyhnlx"
|
||||
path="res://.godot/imported/damage.png-75c6a469140d15eab0a2b7301c5e8959.ctex"
|
||||
uid="uid://ntm66vo10u2q"
|
||||
path="res://.godot/imported/tile.png-289c3a7c75eaae83df78711948565daf.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://_asset/ksw/damage.png"
|
||||
dest_files=["res://.godot/imported/damage.png-75c6a469140d15eab0a2b7301c5e8959.ctex"]
|
||||
source_file="res://_asset/ksw/tile/tile.png"
|
||||
dest_files=["res://.godot/imported/tile.png-289c3a7c75eaae83df78711948565daf.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
After Width: | Height: | Size: 77 KiB |
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cfjprjiin3dnk"
|
||||
path="res://.godot/imported/normal.png-2812748d0b3fe0e26bf430a863bce9c7.ctex"
|
||||
uid="uid://cchtbbig85jcm"
|
||||
path="res://.godot/imported/tile02.png-e8381a8c1a148c3eb8ce3bc8009de863.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://_asset/ksw/normal.png"
|
||||
dest_files=["res://.godot/imported/normal.png-2812748d0b3fe0e26bf430a863bce9c7.ctex"]
|
||||
source_file="res://_asset/ksw/tile/tile02.png"
|
||||
dest_files=["res://.godot/imported/tile02.png-e8381a8c1a148c3eb8ce3bc8009de863.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
|
@ -1,40 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cacik4t6grtq8"
|
||||
path="res://.godot/imported/未命名作品(4).png-151765b68adadae09c88456ac264362b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://_asset/ksw/未命名作品(4).png"
|
||||
dest_files=["res://.godot/imported/未命名作品(4).png-151765b68adadae09c88456ac264362b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene format=3 uid="uid://3vc8ojbiyy5w"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://3vc8ojbiyy5w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://crgac4manhoud" path="res://_game/game.gd" id="1_yksyv"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvqehvdjpoar4" path="res://_player/player_controller.tscn" id="2_x2i0j"]
|
||||
|
|
@ -12,69 +12,34 @@
|
|||
[ext_resource type="PackedScene" uid="uid://7424nctotch0" path="res://_scene/level1/l1_s6.tscn" id="9_m1t3p"]
|
||||
[ext_resource type="PackedScene" uid="uid://dr8a26hfqkh12" path="res://_scene/level1/l1_s7.tscn" id="10_5s0xe"]
|
||||
[ext_resource type="PackedScene" uid="uid://2d457ndb7toe" path="res://_scene/level1/l1_s8.tscn" id="11_ktxjv"]
|
||||
[ext_resource type="PackedScene" uid="uid://dcoq4q3brnkw6" path="res://_scene/level1/l1_s10.tscn" id="12_enubi"]
|
||||
[ext_resource type="PackedScene" uid="uid://bw4jkkpctk1b8" path="res://_scene/level1/l1_s9.tscn" id="13_53pmm"]
|
||||
[ext_resource type="PackedScene" uid="uid://dsw3o2bhc8bve" path="res://_scene/level1/l1_s11.tscn" id="15_n0kgp"]
|
||||
[ext_resource type="PackedScene" uid="uid://5435tmcn1h0x" path="res://_scene/level1/l1_s11_derivative/l1_s11_R1.tscn" id="15_twc26"]
|
||||
[ext_resource type="PackedScene" uid="uid://dalreo21de7vf" path="res://_scene/level1/l1_s11_derivative/l1_s11_R2.tscn" id="16_jibn5"]
|
||||
[ext_resource type="PackedScene" uid="uid://d04rrja6xhmp4" path="res://_scene/level1/l1_s11_derivative/l1_s11_R3.tscn" id="17_ef7py"]
|
||||
[ext_resource type="PackedScene" uid="uid://c681o3efaii8a" path="res://_scene/level1/l1_s11_derivative/l1_s11_R4.tscn" id="18_5vsgs"]
|
||||
[ext_resource type="PackedScene" uid="uid://rkoopuv5ndr2" path="res://_scene/level1/l1_s11_derivative/l1_s11_L1.tscn" id="19_5ctuh"]
|
||||
[ext_resource type="PackedScene" uid="uid://bst6if5k6muxy" path="res://_scene/level1/l1_s11_derivative/l1_s11_L2.tscn" id="20_ns8iw"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmqu6k42rd64d" path="res://_scene/level1/l1_s11_derivative/l1_s11_L3.tscn" id="21_n0kgp"]
|
||||
[ext_resource type="PackedScene" uid="uid://dcoq4q3brnkw6" path="res://_scene/level1/l1_s9.tscn" id="12_enubi"]
|
||||
[ext_resource type="PackedScene" uid="uid://dsw3o2bhc8bve" path="res://_scene/level1/l1_s10.tscn" id="13_53pmm"]
|
||||
|
||||
[node name="Game" type="Node2D" unique_id=1155642617 groups=["PLAYER_RESPAWN"]]
|
||||
[node name="Game" type="Node2D" groups=["PLAYER_RESPAWN"]]
|
||||
script = ExtResource("1_yksyv")
|
||||
metadata/_edit_vertical_guides_ = [1074.0]
|
||||
|
||||
[node name="PlayerController" parent="." unique_id=1762035755 instance=ExtResource("2_x2i0j")]
|
||||
[node name="PlayerController" parent="." instance=ExtResource("2_x2i0j")]
|
||||
|
||||
[node name="PlateformerCamera" parent="." unique_id=236758593 instance=ExtResource("3_enubi")]
|
||||
[node name="PlateformerCamera" parent="." instance=ExtResource("3_enubi")]
|
||||
|
||||
[node name="L0_S0" parent="." unique_id=468557684 instance=ExtResource("3_4ifj7")]
|
||||
[node name="L0_S0" parent="." instance=ExtResource("3_4ifj7")]
|
||||
|
||||
[node name="L1_S1" parent="." unique_id=153388085 instance=ExtResource("4_m1t3p")]
|
||||
[node name="L1_S1" parent="." instance=ExtResource("4_m1t3p")]
|
||||
|
||||
[node name="L1_S2" parent="." unique_id=365454739 instance=ExtResource("5_5s0xe")]
|
||||
[node name="L1_S2" parent="." instance=ExtResource("5_5s0xe")]
|
||||
|
||||
[node name="L1_S3" parent="." unique_id=1491102572 instance=ExtResource("6_ktxjv")]
|
||||
[node name="L1_S3" parent="." instance=ExtResource("6_ktxjv")]
|
||||
|
||||
[node name="L1_S4" parent="." unique_id=779321283 instance=ExtResource("7_x2i0j")]
|
||||
[node name="L1_S4" parent="." instance=ExtResource("7_x2i0j")]
|
||||
|
||||
[node name="L1_S5" parent="." unique_id=1462709098 instance=ExtResource("7_4ifj7")]
|
||||
[node name="L1_S5" parent="." instance=ExtResource("7_4ifj7")]
|
||||
|
||||
[node name="L1_S6" parent="." unique_id=37322839 instance=ExtResource("9_m1t3p")]
|
||||
[node name="L1_S6" parent="." instance=ExtResource("9_m1t3p")]
|
||||
|
||||
[node name="L1_S7" parent="." unique_id=384593411 instance=ExtResource("10_5s0xe")]
|
||||
[node name="L1_S7" parent="." instance=ExtResource("10_5s0xe")]
|
||||
|
||||
[node name="L1_S8" parent="." unique_id=784953402 instance=ExtResource("11_ktxjv")]
|
||||
[node name="L1_S8" parent="." groups=["GRAPABLE"] instance=ExtResource("11_ktxjv")]
|
||||
|
||||
[node name="L1_S9" parent="." unique_id=1409865054 instance=ExtResource("13_53pmm")]
|
||||
position = Vector2(-608, -16)
|
||||
[node name="L1_S9" parent="." instance=ExtResource("12_enubi")]
|
||||
|
||||
[node name="L1_S10" parent="." unique_id=997505711 instance=ExtResource("12_enubi")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11" parent="." unique_id=99397381 instance=ExtResource("15_n0kgp")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_R1" parent="." unique_id=845126004 instance=ExtResource("15_twc26")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_R2" parent="." unique_id=692644329 instance=ExtResource("16_jibn5")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_R3" parent="." unique_id=2065908461 instance=ExtResource("17_ef7py")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_R4" parent="." unique_id=1329785958 instance=ExtResource("18_5vsgs")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_L1" parent="." unique_id=1598546581 instance=ExtResource("19_5ctuh")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_L2" parent="." unique_id=1168627092 instance=ExtResource("20_ns8iw")]
|
||||
position = Vector2(848, -336)
|
||||
|
||||
[node name="L1_S11_L3" parent="." unique_id=1755237319 instance=ExtResource("21_n0kgp")]
|
||||
position = Vector2(848, -336)
|
||||
[node name="L1_S10" parent="." instance=ExtResource("13_53pmm")]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://x041oerqe1iu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://crgac4manhoud" path="res://_game/game.gd" id="1_n75l0"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvqehvdjpoar4" path="res://_player/player_controller.tscn" id="2_uvy3i"]
|
||||
[ext_resource type="PackedScene" uid="uid://cw6buluknvjj" path="res://_camera/PlateformerCamera.tscn" id="3_j30v4"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3x8beboy1e6y" path="res://_scene/level1/l1_s1_new.tscn" id="4_w37b4"]
|
||||
|
||||
[node name="Game" type="Node2D" groups=["PLAYER_RESPAWN"]]
|
||||
script = ExtResource("1_n75l0")
|
||||
|
||||
[node name="PlayerController" parent="." instance=ExtResource("2_uvy3i")]
|
||||
|
||||
[node name="PlateformerCamera" parent="." instance=ExtResource("3_j30v4")]
|
||||
|
||||
[node name="L1_S1" parent="." instance=ExtResource("4_w37b4")]
|
||||
|
|
@ -11,15 +11,5 @@ func _ready() -> void:
|
|||
#$L1_S7.switch_act_by_id(1)
|
||||
#$L1_S8.switch_act_by_id(1)
|
||||
#$L1_S9.switch_act_by_id(1)
|
||||
#$L1_S10.switch_act_by_id(1)
|
||||
#$L1_S10_R1.switch_act_by_id(1)
|
||||
#$L1_S10_R2.switch_act_by_id(1)
|
||||
#$L1_S10_R3.switch_act_by_id(1)
|
||||
#$L1_S10_R4.switch_act_by_id(1)
|
||||
#$L1_S10_L1.switch_act_by_id(1)
|
||||
#$L1_S10_L2.switch_act_by_id(1)
|
||||
#$L1_S10_L3.switch_act_by_id(1)
|
||||
|
||||
GlobalEvent.player_follow_camera()
|
||||
await get_tree().process_frame
|
||||
get_tree().call_group(&"PLAYER_RESPAWN",&"respawn_avatar")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
extends CanvasLayer
|
||||
|
||||
@export var target: Node2D
|
||||
@onready var rect = $ColorRect
|
||||
|
||||
var mat: ShaderMaterial
|
||||
var last_pos: Vector2
|
||||
|
||||
func _ready():
|
||||
mat = rect.material as ShaderMaterial
|
||||
if target != null:
|
||||
last_pos = target.global_position
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if target == null:
|
||||
return
|
||||
|
||||
if mat == null:
|
||||
return
|
||||
|
||||
var vp_size: Vector2 = get_viewport().get_visible_rect().size
|
||||
|
||||
# 玩家世界坐标
|
||||
var world_pos: Vector2 = target.global_position
|
||||
|
||||
# ✅ 世界 -> 屏幕像素坐标(包含相机影响)
|
||||
var screen_pos: Vector2 = get_viewport().get_canvas_transform() * world_pos
|
||||
|
||||
# 速度方向(世界空间)
|
||||
var vel: Vector2 = (world_pos - last_pos) / max(delta, 0.0001)
|
||||
last_pos = world_pos
|
||||
|
||||
var speed: float = vel.length()
|
||||
var dir: Vector2 = Vector2.RIGHT
|
||||
if speed > 0.001:
|
||||
dir = vel / speed
|
||||
|
||||
# ✅ 船头前移(拨水发生在玩家前面)
|
||||
var front_offset_px: Vector2 = dir * 30.0
|
||||
var uv_front: Vector2 = (screen_pos + front_offset_px) / vp_size
|
||||
uv_front = uv_front.clamp(Vector2(0, 0), Vector2(1, 1))
|
||||
|
||||
|
||||
mat.set_shader_parameter("obj_uv", uv_front)
|
||||
mat.set_shader_parameter("obj_dir", dir)
|
||||
mat.set_shader_parameter("obj_speed", clamp(speed / 600.0, 0.0, 2.0))
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://c5in610cunjn2
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
[ext_resource type="Script" uid="uid://b5hkfpjbye70" path="res://_player/states/idle.gd" id="4_30i7g"]
|
||||
[ext_resource type="BlackboardPlan" uid="uid://nlw7rxugv5uh" path="res://_player/bbp_player.tres" id="4_mwufa"]
|
||||
[ext_resource type="Resource" uid="uid://cs50mkt830f8r" path="res://_camera/camera_shake/CSP_XY.tres" id="5_ciuu3"]
|
||||
[ext_resource type="Texture2D" uid="uid://dted7geb331y2" path="res://_asset/ksw/character.png" id="6_01uoa"]
|
||||
[ext_resource type="Texture2D" uid="uid://bryuhk1hqe4hh" path="res://_asset/ksw/character01.png" id="6_01uoa"]
|
||||
[ext_resource type="Script" uid="uid://bpd54nf8oxwsb" path="res://_player/states/player_hsm.gd" id="6_8q4ov"]
|
||||
[ext_resource type="Script" uid="uid://po21boe8iqcc" path="res://_player/states/move.gd" id="7_rrwxs"]
|
||||
[ext_resource type="Script" uid="uid://cjf7kds0cipkw" path="res://_tools/limbo_state_helper.gd" id="8_clxy3"]
|
||||
|
|
@ -37,14 +37,15 @@
|
|||
[ext_resource type="Script" uid="uid://bijoqygv6tncj" path="res://addons/reedcomponent/SingleComponentRemotor.gd" id="28_mxt3b"]
|
||||
[ext_resource type="Resource" uid="uid://bdad4yjv1q0uu" path="res://_player/effect_binding/jump_dust.tres" id="30_hquoe"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_1a1t3"]
|
||||
radius = 3.0
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_01uoa"]
|
||||
size = Vector2(173, 50)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qnulu"]
|
||||
size = Vector2(9, 11.5)
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ciuu3"]
|
||||
size = Vector2(203, 245)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ogl63"]
|
||||
size = Vector2(10, 10)
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ciuu3"]
|
||||
radius = 134.0
|
||||
height = 338.0
|
||||
|
||||
[node name="Avatar" type="CharacterBody2D" groups=["PLAYER"]]
|
||||
collision_layer = 2
|
||||
|
|
@ -59,26 +60,25 @@ camera_shake_preset = Dictionary[StringName, ExtResource("2_u7cua")]({
|
|||
&"y_only_light": ExtResource("4_01uoa")
|
||||
})
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, 3.9999998)
|
||||
texture = ExtResource("6_01uoa")
|
||||
|
||||
[node name="GroundCompanion" type="Area2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, 11)
|
||||
position = Vector2(0, 160)
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundCompanion"]
|
||||
shape = SubResource("CircleShape2D_1a1t3")
|
||||
position = Vector2(0, -10)
|
||||
shape = SubResource("RectangleShape2D_01uoa")
|
||||
debug_color = Color(0, 0.63529414, 0.40784314, 0.41960785)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, 5.75)
|
||||
shape = SubResource("RectangleShape2D_qnulu")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, 3.9999998)
|
||||
scale = Vector2(0.1, 0.1)
|
||||
texture = ExtResource("6_01uoa")
|
||||
position = Vector2(0, 40)
|
||||
shape = SubResource("RectangleShape2D_ciuu3")
|
||||
|
||||
[node name="LimboStateDebugger" type="Node2D" parent="." node_paths=PackedStringArray("state_root")]
|
||||
script = ExtResource("8_clxy3")
|
||||
|
|
@ -163,28 +163,47 @@ unique_name_in_owner = true
|
|||
script = ExtResource("2_11vl8")
|
||||
dash_speed = 400.0
|
||||
end_dash_speed = 190.0
|
||||
climb_hop_velocity_x = 180.0
|
||||
climb_hop_velocity_y = 334.0
|
||||
jump_force = 460.0
|
||||
climb_max_speed_upward = 450.0
|
||||
climb_max_speed_downward = 800.0
|
||||
climb_acceleration = 3000.0
|
||||
climb_hop_velocity_x = 1400.0
|
||||
climb_hop_velocity_y = 2600.0
|
||||
climb_jump_velocity_x = 1800.0
|
||||
climb_jump_velocity_y = 3300.0
|
||||
custom_move_force = 10000.0
|
||||
custom_move_max_speed = 4500.0
|
||||
custom_move_stop_distance = 40.0
|
||||
jump_force = 5800.0
|
||||
jump_hold_maxium_time = 0.125
|
||||
jump_horizontal_Boost = 160.0
|
||||
jump_countinus_horizontal_Boost = 500.0
|
||||
jump_horizontal_Boost = 5600.0
|
||||
jump_countinus_horizontal_Boost = 4000.0
|
||||
jump_horizontal_Boost_last_time = 0.12
|
||||
light_gravity_threshold = 135.0
|
||||
max_jump_horizontal_boost_speed = 3600.0
|
||||
light_gravity_threshold = 1200.0
|
||||
light_gravity_mult = 0.6
|
||||
wall_jump_base_force_x = 260.0
|
||||
wall_jump_base_force_y = 220.0
|
||||
fall_maxium_speed = 430.0
|
||||
air_control_mult = 0.35
|
||||
run_accel = 1300.0
|
||||
run_reduce = 2400.0
|
||||
move_speed_max = 202.0
|
||||
wall_slide_fall_maxium_speed = 5000.0
|
||||
wall_jump_base_force_x = 2800.0
|
||||
wall_jump_base_force_y = 1600.0
|
||||
fall_maxium_speed = 8000.0
|
||||
air_control_mult = 0.55
|
||||
run_accel = 15000.0
|
||||
run_reduce = 20000.0
|
||||
move_speed_max = 2650.0
|
||||
|
||||
[node name="WallDetector" parent="LocomotionComponent" instance=ExtResource("20_air0b")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="UpRayCast2D" parent="LocomotionComponent/WallDetector" index="0"]
|
||||
position = Vector2(0, -141)
|
||||
target_position = Vector2(155, 0)
|
||||
|
||||
[node name="MidRayCast2D" parent="LocomotionComponent/WallDetector" index="1"]
|
||||
position = Vector2(0, 3)
|
||||
position = Vector2(0, 42)
|
||||
target_position = Vector2(154, 0)
|
||||
|
||||
[node name="DownRayCast2D" parent="LocomotionComponent/WallDetector" index="2"]
|
||||
position = Vector2(0, 151)
|
||||
target_position = Vector2(155, 0)
|
||||
|
||||
[node name="SpawnHookComponet" type="Node" parent="."]
|
||||
script = ExtResource("21_p14kj")
|
||||
|
|
@ -209,8 +228,7 @@ collision_layer = 0
|
|||
collision_mask = 8
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="HitBox"]
|
||||
position = Vector2(0, 5)
|
||||
shape = SubResource("RectangleShape2D_ogl63")
|
||||
shape = SubResource("CapsuleShape2D_ciuu3")
|
||||
debug_color = Color(0.95815283, 0, 0.5313341, 0.41960785)
|
||||
|
||||
[node name="RemotePositionSetting" type="Node2D" parent="."]
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ func _draw() -> void:
|
|||
var a_x: float = clampf(abs(velocity.x),1,2000) * .3 * sign(locomotion_comp._current_acceleration.x)
|
||||
var a_y: float = clampf(abs(velocity.x),1,2000) * .3 * sign(locomotion_comp._current_acceleration.y)
|
||||
|
||||
draw_line(Vector2.ZERO,Vector2(x, 0),Color.RED,4)
|
||||
draw_line(Vector2.ZERO,Vector2(0, y),Color.GREEN,4)
|
||||
draw_line(Vector2.ZERO,Vector2(x, 0),Color.RED,40)
|
||||
draw_line(Vector2.ZERO,Vector2(0, y),Color.GREEN,40)
|
||||
|
||||
draw_line(Vector2.ZERO,Vector2(a_x, 0),Color.YELLOW,2)
|
||||
draw_line(Vector2.ZERO,Vector2(0, a_y),Color.PURPLE,2)
|
||||
draw_line(Vector2.ZERO,Vector2(a_x, 0),Color.YELLOW,20)
|
||||
draw_line(Vector2.ZERO,Vector2(0, a_y),Color.PURPLE,20)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
queue_redraw()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="ReedPropEffect" format=3 uid="uid://bjjxh7g7iosla"]
|
||||
[gd_resource type="Resource" script_class="ReedPropEffect" load_steps=6 format=3 uid="uid://bjjxh7g7iosla"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cdvgq0xqdbagk" path="res://addons/reedscene/prop/Effect/ReedPropEffect.gd" id="1_4meba"]
|
||||
[ext_resource type="Script" uid="uid://bf1qlvdbf8qdp" path="res://addons/reedscene/prop/Effect/EAT_CallFunc.gd" id="1_qrdf4"]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="ReedPropEffect" format=3 uid="uid://458r8rf7x02p"]
|
||||
[gd_resource type="Resource" script_class="ReedPropEffect" load_steps=6 format=3 uid="uid://458r8rf7x02p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bf1qlvdbf8qdp" path="res://addons/reedscene/prop/Effect/EAT_CallFunc.gd" id="1_lgnrf"]
|
||||
[ext_resource type="Script" uid="uid://cdvgq0xqdbagk" path="res://addons/reedscene/prop/Effect/ReedPropEffect.gd" id="2_lgnrf"]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
[gd_scene format=3 uid="uid://d20u8tfktepxg"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://d20u8tfktepxg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b7o5456qrwgbf" path="res://_props/_prefabs/collection/collection_prefab.gd" id="1_8ns1b"]
|
||||
[ext_resource type="Texture2D" uid="uid://c673bap4b12fx" path="res://icon.svg" id="2_qf7ju"]
|
||||
|
||||
[node name="CollectionPrefab" type="Area2D" unique_id=647938263]
|
||||
[node name="CollectionPrefab" type="Area2D"]
|
||||
collision_layer = 16
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_8ns1b")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=486383318]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
texture = ExtResource("2_qf7ju")
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
extends AnimatableBody2D
|
||||
|
||||
@export var shaking_target: Node2D
|
||||
@export var shake_strength: float = 8.0
|
||||
@export var shake_duration: float = 0.25
|
||||
@export var shake_hz: float = 12.0 # 每秒抖几次(关键参数)
|
||||
|
||||
signal shaking_finished()
|
||||
|
||||
var _origin_pos: Vector2
|
||||
var _shaking := false
|
||||
var _rng := RandomNumberGenerator.new()
|
||||
|
||||
func _ready() -> void:
|
||||
if not shaking_target:
|
||||
shaking_target = self
|
||||
_rng.randomize()
|
||||
|
||||
func shaking() -> void:
|
||||
if _shaking:
|
||||
return
|
||||
|
||||
if not shaking_target:
|
||||
shaking_target = self
|
||||
|
||||
_origin_pos = shaking_target.position
|
||||
_shaking = true
|
||||
|
||||
var end_timer := get_tree().create_timer(shake_duration)
|
||||
var interval : float = 1.0 / max(shake_hz, 1.0)
|
||||
var next_update := 0.0
|
||||
var current_offset := Vector2.ZERO
|
||||
|
||||
while end_timer.time_left > 0.0:
|
||||
next_update -= get_process_delta_time()
|
||||
|
||||
if next_update <= 0.0:
|
||||
current_offset = Vector2(
|
||||
randf_range(-shake_strength, shake_strength),
|
||||
randf_range(-shake_strength, shake_strength)
|
||||
)
|
||||
next_update = interval
|
||||
|
||||
shaking_target.position = _origin_pos + current_offset
|
||||
await get_tree().process_frame
|
||||
|
||||
shaking_target.position = _origin_pos
|
||||
_shaking = false
|
||||
shaking_finished.emit()
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://dmamoiy8sl0bn
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://goua2e1q7qq6"]
|
||||
|
||||
[node name="FragileShakingPlatform" type="Node2D"]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="ReedPropEffect" format=3 uid="uid://dd4df6yjkeifa"]
|
||||
[gd_resource type="Resource" script_class="ReedPropEffect" load_steps=6 format=3 uid="uid://dd4df6yjkeifa"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cdvgq0xqdbagk" path="res://addons/reedscene/prop/Effect/ReedPropEffect.gd" id="1_bxu3h"]
|
||||
[ext_resource type="Script" uid="uid://bf1qlvdbf8qdp" path="res://addons/reedscene/prop/Effect/EAT_CallFunc.gd" id="1_y2h7j"]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="ReedPropEffect" format=3 uid="uid://b6iglvt36pm55"]
|
||||
[gd_resource type="Resource" script_class="ReedPropEffect" load_steps=6 format=3 uid="uid://b6iglvt36pm55"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cdvgq0xqdbagk" path="res://addons/reedscene/prop/Effect/ReedPropEffect.gd" id="1_3md03"]
|
||||
[ext_resource type="Script" uid="uid://bf1qlvdbf8qdp" path="res://addons/reedscene/prop/Effect/EAT_CallFunc.gd" id="1_uj0dv"]
|
||||
|
|
|
|||
|
|
@ -1,176 +0,0 @@
|
|||
class_name VinePlatform
|
||||
extends StaticBody2D
|
||||
|
||||
|
||||
## ===== 节点引用 =====
|
||||
@onready var player_trigger: Area2D = %PlayerTriggerVolumn
|
||||
@onready var hook_trigger: Area2D = %HookAttractVolumn
|
||||
@onready var sprite: Sprite2D = $Sprite2D
|
||||
@onready var collision: CollisionShape2D = $CollisionShape2D
|
||||
|
||||
|
||||
## ===== 配置 =====
|
||||
|
||||
## 触发到消失的总时间(固定)
|
||||
@export var destroy_total_time: float = 2.0
|
||||
|
||||
## 触发后多久开始抖动(可调)
|
||||
@export var shake_start_time: float = 1.0
|
||||
|
||||
## 消失后多久恢复(再生时间)
|
||||
@export var respawn_time: float = 3.0
|
||||
|
||||
|
||||
## 抖动参数
|
||||
@export var shake_x: float = 1.0
|
||||
@export var shake_y: float = 1.0
|
||||
@export var step_time: float = 0.034
|
||||
|
||||
|
||||
## ===== 状态机 =====
|
||||
enum State {
|
||||
IDLE,
|
||||
TRIGGERED,
|
||||
DISAPPEARED
|
||||
}
|
||||
|
||||
var _current_state: State = State.IDLE
|
||||
|
||||
|
||||
## ===== 抖动控制 =====
|
||||
var _shake_tween: Tween
|
||||
var _shake_origin_pos: Vector2
|
||||
|
||||
## 防止重复触发
|
||||
var _sequence_started := false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
player_trigger.body_entered.connect(_on_player_entered)
|
||||
hook_trigger.body_entered.connect(_on_hook_hit)
|
||||
|
||||
|
||||
## ==============================
|
||||
## 状态切换
|
||||
## ==============================
|
||||
func change_state(new_state: State) -> void:
|
||||
if new_state == _current_state:
|
||||
return
|
||||
|
||||
_current_state = new_state
|
||||
|
||||
match new_state:
|
||||
State.IDLE:
|
||||
_enable_platform(true)
|
||||
|
||||
State.TRIGGERED:
|
||||
_start_destroy_sequence()
|
||||
|
||||
State.DISAPPEARED:
|
||||
_disappear_and_respawn()
|
||||
|
||||
|
||||
## ==============================
|
||||
## 触发入口
|
||||
## ==============================
|
||||
|
||||
func _on_player_entered(body: Node) -> void:
|
||||
if body is Player:
|
||||
_trigger_platform()
|
||||
|
||||
|
||||
func _on_hook_hit(hit_pos: Vector2, hook: Hook) -> void:
|
||||
_trigger_platform()
|
||||
|
||||
|
||||
|
||||
func _trigger_platform() -> void:
|
||||
if _sequence_started:
|
||||
return
|
||||
_sequence_started = true
|
||||
|
||||
print("藤蔓平台触发:2秒后消失,再生时间:", respawn_time)
|
||||
|
||||
change_state(State.TRIGGERED)
|
||||
|
||||
|
||||
## ==============================
|
||||
## 销毁流程:抖动 + 消失(非销毁)
|
||||
## ==============================
|
||||
func _start_destroy_sequence() -> void:
|
||||
var shake_time: float = clampf(shake_start_time, 0.0, destroy_total_time)
|
||||
var remaining_time: float = destroy_total_time - shake_time
|
||||
|
||||
# 前半段静止
|
||||
if shake_time > 0.0:
|
||||
await get_tree().create_timer(shake_time).timeout
|
||||
|
||||
# 后半段抖动
|
||||
if remaining_time > 0.0:
|
||||
start_shaking()
|
||||
await get_tree().create_timer(remaining_time).timeout
|
||||
|
||||
stop_shaking()
|
||||
|
||||
# 进入消失状态
|
||||
change_state(State.DISAPPEARED)
|
||||
|
||||
|
||||
## ==============================
|
||||
## 消失 + 再生
|
||||
## ==============================
|
||||
func _disappear_and_respawn() -> void:
|
||||
print("平台消失,等待再生...")
|
||||
|
||||
# 关闭平台
|
||||
_enable_platform(false)
|
||||
|
||||
# 等待再生时间
|
||||
await get_tree().create_timer(respawn_time).timeout
|
||||
|
||||
print("平台恢复!")
|
||||
|
||||
# 重置触发锁
|
||||
_sequence_started = false
|
||||
|
||||
# 回到初始状态
|
||||
change_state(State.IDLE)
|
||||
|
||||
|
||||
## ==============================
|
||||
## 启用/禁用平台(关键)
|
||||
## ==============================
|
||||
func _enable_platform(enable: bool) -> void:
|
||||
sprite.visible = enable
|
||||
collision.disabled = not enable
|
||||
|
||||
player_trigger.monitoring = enable
|
||||
hook_trigger.monitoring = enable
|
||||
|
||||
|
||||
## ==============================
|
||||
## 抖动效果
|
||||
## ==============================
|
||||
func start_shaking() -> void:
|
||||
if _shake_tween and _shake_tween.is_running():
|
||||
return
|
||||
|
||||
_shake_origin_pos = sprite.position
|
||||
|
||||
_shake_tween = create_tween()
|
||||
_shake_tween.set_loops()
|
||||
_shake_tween.set_trans(Tween.TRANS_SINE)
|
||||
_shake_tween.set_ease(Tween.EASE_IN_OUT)
|
||||
|
||||
_shake_tween.tween_property(sprite, "position", _shake_origin_pos + Vector2(-shake_x, -shake_y), step_time)
|
||||
_shake_tween.tween_property(sprite, "position", _shake_origin_pos + Vector2(shake_x, shake_y), step_time)
|
||||
_shake_tween.tween_property(sprite, "position", _shake_origin_pos + Vector2(-shake_x, shake_y), step_time)
|
||||
_shake_tween.tween_property(sprite, "position", _shake_origin_pos + Vector2(shake_x, -shake_y), step_time)
|
||||
|
||||
|
||||
func stop_shaking() -> void:
|
||||
if _shake_tween:
|
||||
_shake_tween.kill()
|
||||
_shake_tween = null
|
||||
|
||||
sprite.position = _shake_origin_pos
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://bog8pjjhrcd3g
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://dfwups0m7a5m4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c673bap4b12fx" path="res://icon.svg" id="1_a6xdh"]
|
||||
[ext_resource type="Script" uid="uid://bog8pjjhrcd3g" path="res://_props/_prefabs/vine_platform/vine_platform.gd" id="1_jux4m"]
|
||||
[ext_resource type="PackedScene" uid="uid://bonrls3iuhdqb" path="res://_props/_prefabs/player/player_trigger_volumn.tscn" id="2_1eb6k"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1eb6k"]
|
||||
size = Vector2(32, 16)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1ul4y"]
|
||||
size = Vector2(32, 24)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jux4m"]
|
||||
size = Vector2(38, 22)
|
||||
|
||||
[node name="VinePlatform" type="StaticBody2D" unique_id=1779509136 groups=["GRAPABLE"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_jux4m")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1586582263]
|
||||
scale = Vector2(0.24999999, 0.125)
|
||||
texture = ExtResource("1_a6xdh")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=314807201]
|
||||
shape = SubResource("RectangleShape2D_1eb6k")
|
||||
debug_color = Color(1, 0.24705882, 0.40784314, 0.41960785)
|
||||
|
||||
[node name="PlayerTriggerVolumn" parent="." unique_id=869831136 instance=ExtResource("2_1eb6k")]
|
||||
unique_name_in_owner = true
|
||||
debug_print = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTriggerVolumn" unique_id=209979624]
|
||||
position = Vector2(0, -4)
|
||||
shape = SubResource("RectangleShape2D_1ul4y")
|
||||
debug_color = Color(0.19215687, 0.6431373, 0, 0)
|
||||
|
||||
[node name="HookAttractVolumn" type="Area2D" parent="." unique_id=71519728]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 32
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="HookAttractVolumn" unique_id=1847255495]
|
||||
shape = SubResource("RectangleShape2D_jux4m")
|
||||
debug_color = Color(1, 0, 0.14509805, 0)
|
||||
|
|
@ -2,7 +2,6 @@ extends CharacterBody2D
|
|||
|
||||
@onready var player_collectable_volumn: PlayerTriggerVolumn = %PlayerCollectableVolumn
|
||||
@onready var hook_attract_volumn: Area2D = %HookAttractVolumn
|
||||
@export var respawn_time: float = 2.0
|
||||
|
||||
enum State {
|
||||
IDLE,
|
||||
|
|
@ -11,7 +10,6 @@ enum State {
|
|||
}
|
||||
|
||||
var _current_state: State = State.IDLE
|
||||
var _spawn_position: Vector2
|
||||
|
||||
## 拉回速度
|
||||
@export var pull_speed: float = 800.0
|
||||
|
|
@ -19,7 +17,6 @@ var _spawn_position: Vector2
|
|||
var _pull_target: Node2D
|
||||
|
||||
func _ready() -> void:
|
||||
_spawn_position = global_position
|
||||
player_collectable_volumn.player_entered.connect(_on_player_collected)
|
||||
|
||||
##状态管理函数
|
||||
|
|
@ -45,7 +42,7 @@ func change_state(in_state: State) -> void:
|
|||
State.PULLED_BY_HOOK:
|
||||
pass
|
||||
State.COLLECTED:
|
||||
_on_collected_enter()
|
||||
queue_free()
|
||||
|
||||
## 钩爪击中时调用(hit_pos 是击中点,hook 是钩爪实例)
|
||||
func on_hook_hit(hit_pos: Vector2, hook: Hook) -> void:
|
||||
|
|
@ -71,41 +68,3 @@ func _on_player_collected(body:CharacterBody2D) -> void:
|
|||
if body is Player:
|
||||
body.hsm.dispatch(&"trigger_external_dash")
|
||||
change_state(State.COLLECTED)
|
||||
|
||||
func _on_collected_enter() -> void:
|
||||
velocity = Vector2.ZERO
|
||||
|
||||
# 隐藏
|
||||
visible = false
|
||||
set_physics_process(false)
|
||||
|
||||
# 关闭碰撞
|
||||
if has_node("CollisionShape2D"):
|
||||
$CollisionShape2D.disabled = true
|
||||
|
||||
player_collectable_volumn.monitoring = false
|
||||
player_collectable_volumn.monitorable = false
|
||||
hook_attract_volumn.monitoring = false
|
||||
hook_attract_volumn.monitorable = false
|
||||
|
||||
# 启动重生流程
|
||||
_respawn_after_delay()
|
||||
|
||||
func _respawn_after_delay() -> void:
|
||||
await get_tree().create_timer(respawn_time).timeout
|
||||
|
||||
global_position = _spawn_position
|
||||
|
||||
visible = true
|
||||
set_physics_process(true)
|
||||
|
||||
if has_node("CollisionShape2D"):
|
||||
$CollisionShape2D.disabled = false
|
||||
|
||||
player_collectable_volumn.monitoring = true
|
||||
player_collectable_volumn.monitorable = true
|
||||
hook_attract_volumn.monitoring = true
|
||||
hook_attract_volumn.monitorable = true
|
||||
|
||||
change_state(State.IDLE)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene format=3 uid="uid://bju8jr1w4d60m"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bju8jr1w4d60m"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c673bap4b12fx" path="res://icon.svg" id="1_dd62g"]
|
||||
[ext_resource type="Script" uid="uid://cvrty667x12i6" path="res://_props/spring/spring.gd" id="1_mfmm2"]
|
||||
|
|
@ -6,16 +6,16 @@
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_wsen7"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[node name="spring" type="Area2D" unique_id=470552845 groups=["GRAPABLE"]]
|
||||
[node name="spring" type="Area2D" groups=["GRAPABLE"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_mfmm2")
|
||||
jump_speed = 1000.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=506922243]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(-2.3841858e-07, 0)
|
||||
scale = Vector2(0.12499999, 0.125)
|
||||
texture = ExtResource("1_dd62g")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=97358040]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_wsen7")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene format=3 uid="uid://badmoya3nd161"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://badmoya3nd161"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dajlxaybacxxc" path="res://_props/trigger_fall_rock_climb/trigger_fall_rock_climb.gd" id="1_n6tyk"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmjwk4gr1nfns" path="res://_props/_prefabs/rock.tscn" id="2_ibofv"]
|
||||
|
|
@ -11,31 +11,31 @@ size = Vector2(52, 52)
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mvp6g"]
|
||||
size = Vector2(54, 52.5)
|
||||
|
||||
[node name="TriggerFallRock_Climb" type="Node2D" unique_id=788823859]
|
||||
scale = Vector2(0.9, 0.9)
|
||||
[node name="TriggerFallRock_Climb" type="Node2D"]
|
||||
script = ExtResource("1_n6tyk")
|
||||
|
||||
[node name="rock" parent="." unique_id=1121422701 instance=ExtResource("2_ibofv")]
|
||||
[node name="rock" parent="." instance=ExtResource("2_ibofv")]
|
||||
position = Vector2(0, -74)
|
||||
falling_gravity = 600.0
|
||||
max_fall_speed = 1500.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="rock" unique_id=2092021495]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="rock"]
|
||||
position = Vector2(0, 73.99999)
|
||||
scale = Vector2(0.405, 0.405)
|
||||
texture = ExtResource("3_mb81t")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="rock" unique_id=2039714799]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="rock"]
|
||||
position = Vector2(0, 74)
|
||||
shape = SubResource("RectangleShape2D_vv0hj")
|
||||
debug_color = Color(0.99629647, 0, 0.19810504, 0.41960785)
|
||||
|
||||
[node name="PlayerTriggerVolumn" parent="." unique_id=296183028 instance=ExtResource("4_txegh")]
|
||||
[node name="PlayerTriggerVolumn" parent="." instance=ExtResource("4_txegh")]
|
||||
debug_print = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTriggerVolumn" unique_id=1068719796]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTriggerVolumn"]
|
||||
position = Vector2(0, -0.75)
|
||||
shape = SubResource("RectangleShape2D_mvp6g")
|
||||
|
||||
[node name="Timer" type="Timer" parent="." unique_id=1698795583]
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 0.8
|
||||
one_shot = true
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene format=3 uid="uid://knrcnoedxvm6"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://knrcnoedxvm6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b8yl6l3tlam86" path="res://_props/trigger_fall_rock_hazard/trigger_fall_rock_hazard.gd" id="1_2ms0f"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmjwk4gr1nfns" path="res://_props/_prefabs/rock.tscn" id="2_ww3ib"]
|
||||
|
|
@ -11,30 +11,29 @@ size = Vector2(52, 52)
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mvp6g"]
|
||||
size = Vector2(52, 108.5)
|
||||
|
||||
[node name="TriggerFallRock_Hazard" type="Node2D" unique_id=248471 groups=["ROCK_BREAK"]]
|
||||
scale = Vector2(0.9, 0.9)
|
||||
[node name="TriggerFallRock_Hazard" type="Node2D"]
|
||||
script = ExtResource("1_2ms0f")
|
||||
|
||||
[node name="rock" parent="." unique_id=1315018512 groups=["ROCK_BREAK"] instance=ExtResource("2_ww3ib")]
|
||||
[node name="rock" parent="." instance=ExtResource("2_ww3ib")]
|
||||
position = Vector2(0, -82)
|
||||
falling_gravity = 600.0
|
||||
max_fall_speed = 1000.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="rock" unique_id=947610890]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="rock"]
|
||||
scale = Vector2(0.405, 0.405)
|
||||
texture = ExtResource("3_f8vfu")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="rock" unique_id=93634710]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="rock"]
|
||||
shape = SubResource("RectangleShape2D_vv0hj")
|
||||
debug_color = Color(0.99629647, 0, 0.19810504, 0.41960785)
|
||||
|
||||
[node name="PlayerTriggerVolumn" parent="." unique_id=182002080 instance=ExtResource("4_s77mb")]
|
||||
[node name="PlayerTriggerVolumn" parent="." instance=ExtResource("4_s77mb")]
|
||||
debug_print = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTriggerVolumn" unique_id=821875896]
|
||||
position = Vector2(0, -4)
|
||||
scale = Vector2(1, 1.92)
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTriggerVolumn"]
|
||||
position = Vector2(0, -54)
|
||||
shape = SubResource("RectangleShape2D_mvp6g")
|
||||
|
||||
[node name="Timer" type="Timer" parent="." unique_id=130846245]
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 0.8
|
||||
one_shot = true
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
extends VinePlatform
|
||||
|
||||
@export var jump_speed: float = 600.0 # 向上的初速度
|
||||
|
||||
##跳跃声音特效
|
||||
signal s_jump_sound
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
|
||||
|
||||
func _on_player_entered(body: Node) -> void:
|
||||
# 只处理 CharacterBody2D
|
||||
if body is Player:
|
||||
_trigger_platform()
|
||||
# 给予垂直向上的速度
|
||||
var dir := -global_transform.y.normalized()
|
||||
body.velocity = dir * jump_speed
|
||||
# 播放弹簧音效
|
||||
on_ejection()
|
||||
# 触发破碎机制
|
||||
_trigger_platform()
|
||||
|
||||
|
||||
func on_ejection() -> void:
|
||||
# 播放弹簧音效
|
||||
s_jump_sound.emit()
|
||||
|
|
@ -1 +0,0 @@
|
|||
uid://bike0n5pc38qk
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
[gd_scene format=3 uid="uid://b188rk1rmyb2h"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bike0n5pc38qk" path="res://_props/vine_spring/vine_spring.gd" id="1_p0in6"]
|
||||
[ext_resource type="Texture2D" uid="uid://c673bap4b12fx" path="res://icon.svg" id="2_c0rfy"]
|
||||
[ext_resource type="PackedScene" uid="uid://bonrls3iuhdqb" path="res://_props/_prefabs/player/player_trigger_volumn.tscn" id="3_ejnsy"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1eb6k"]
|
||||
size = Vector2(32, 16)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1ul4y"]
|
||||
size = Vector2(32, 24)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jux4m"]
|
||||
size = Vector2(38, 22)
|
||||
|
||||
[node name="VineSpring" type="StaticBody2D" unique_id=1779509136 groups=["GRAPABLE"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_p0in6")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1586582263]
|
||||
scale = Vector2(0.24999999, 0.125)
|
||||
texture = ExtResource("2_c0rfy")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=314807201]
|
||||
shape = SubResource("RectangleShape2D_1eb6k")
|
||||
debug_color = Color(1, 0.24705882, 0.40784314, 0.41960785)
|
||||
|
||||
[node name="PlayerTriggerVolumn" parent="." unique_id=869831136 instance=ExtResource("3_ejnsy")]
|
||||
unique_name_in_owner = true
|
||||
debug_print = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerTriggerVolumn" unique_id=209979624]
|
||||
position = Vector2(0, -4)
|
||||
shape = SubResource("RectangleShape2D_1ul4y")
|
||||
debug_color = Color(0.19215687, 0.6431373, 0, 0)
|
||||
|
||||
[node name="HookAttractVolumn" type="Area2D" parent="." unique_id=71519728]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 32
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="HookAttractVolumn" unique_id=1847255495]
|
||||
shape = SubResource("RectangleShape2D_jux4m")
|
||||
debug_color = Color(1, 0, 0.14509805, 0)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="Resource" script_class="SceneTrigger" format=3 uid="uid://bym4pb0ellj7b"]
|
||||
[gd_resource type="Resource" script_class="SceneTrigger" load_steps=19 format=3 uid="uid://bym4pb0ellj7b"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ons77en82uls" path="res://addons/reedscene/scene/scene_trigger/base/SceneTrigger.gd" id="2_cq8o1"]
|
||||
[ext_resource type="Script" uid="uid://dxj5vimigc651" path="res://addons/reedscene/scene/scene_trigger/base/SceneTriggerEffectPair.gd" id="3_m0qh3"]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://rrlq7ucvgbsv"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://b14j7g5tolgq" path="res://_shader/new_shader.gdshader" id="1_kkjpc"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfjprjiin3dnk" path="res://_asset/ksw/normal.png" id="2_kkjpc"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_iixbh"]
|
||||
shader = ExtResource("1_kkjpc")
|
||||
shader_parameter/amount = 20.0
|
||||
shader_parameter/move = 1.0
|
||||
shader_parameter/bandsize = 0.1
|
||||
shader_parameter/speed = 1.0
|
||||
|
||||
[node name="Ripple" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_iixbh")
|
||||
texture = ExtResource("2_kkjpc")
|
||||
|
|
@ -1,8 +1,129 @@
|
|||
[gd_resource type="TileSet" load_steps=5 format=3 uid="uid://cup1q1upvp18h"]
|
||||
[gd_resource type="TileSet" load_steps=9 format=3 uid="uid://cup1q1upvp18h"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dnrvktjrinxon" path="res://_asset/tile/pure_color_tile.png" id="1_u6jqb"]
|
||||
[ext_resource type="Texture2D" uid="uid://dd622t4mw5vva" path="res://_asset/ksw/basicTile01.png" id="2_mucy5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dufe0liirugbw" path="res://_asset/ksw/basicTile02.png" id="3_u6jqb"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_h7jxu"]
|
||||
texture = ExtResource("1_u6jqb")
|
||||
texture_region_size = Vector2i(128, 128)
|
||||
1:1/0 = 0
|
||||
2:1/0 = 0
|
||||
3:1/0 = 0
|
||||
4:1/0 = 0
|
||||
5:1/0 = 0
|
||||
6:1/0 = 0
|
||||
7:1/0 = 0
|
||||
8:1/0 = 0
|
||||
9:1/0 = 0
|
||||
10:1/0 = 0
|
||||
12:1/0 = 0
|
||||
13:1/0 = 0
|
||||
16:1/0 = 0
|
||||
17:1/0 = 0
|
||||
18:1/0 = 0
|
||||
1:2/0 = 0
|
||||
2:2/0 = 0
|
||||
3:2/0 = 0
|
||||
4:2/0 = 0
|
||||
5:2/0 = 0
|
||||
6:2/0 = 0
|
||||
7:2/0 = 0
|
||||
8:2/0 = 0
|
||||
9:2/0 = 0
|
||||
10:2/0 = 0
|
||||
16:2/0 = 0
|
||||
17:2/0 = 0
|
||||
18:2/0 = 0
|
||||
1:3/0 = 0
|
||||
2:3/0 = 0
|
||||
4:3/0 = 0
|
||||
5:3/0 = 0
|
||||
6:3/0 = 0
|
||||
7:3/0 = 0
|
||||
8:3/0 = 0
|
||||
9:3/0 = 0
|
||||
10:3/0 = 0
|
||||
1:4/0 = 0
|
||||
2:4/0 = 0
|
||||
3:4/0 = 0
|
||||
4:4/0 = 0
|
||||
5:4/0 = 0
|
||||
6:4/0 = 0
|
||||
7:4/0 = 0
|
||||
8:4/0 = 0
|
||||
9:4/0 = 0
|
||||
10:4/0 = 0
|
||||
12:4/0 = 0
|
||||
13:4/0 = 0
|
||||
1:5/0 = 0
|
||||
2:5/0 = 0
|
||||
3:5/0 = 0
|
||||
4:5/0 = 0
|
||||
5:5/0 = 0
|
||||
6:5/0 = 0
|
||||
7:5/0 = 0
|
||||
8:5/0 = 0
|
||||
9:5/0 = 0
|
||||
10:5/0 = 0
|
||||
12:5/0 = 0
|
||||
13:5/0 = 0
|
||||
12:6/0 = 0
|
||||
13:6/0 = 0
|
||||
12:7/0 = 0
|
||||
13:7/0 = 0
|
||||
6:9/0 = 0
|
||||
7:9/0 = 0
|
||||
8:9/0 = 0
|
||||
9:9/0 = 0
|
||||
10:9/0 = 0
|
||||
11:9/0 = 0
|
||||
12:9/0 = 0
|
||||
13:9/0 = 0
|
||||
6:10/0 = 0
|
||||
7:10/0 = 0
|
||||
8:10/0 = 0
|
||||
9:10/0 = 0
|
||||
10:10/0 = 0
|
||||
11:10/0 = 0
|
||||
12:10/0 = 0
|
||||
13:10/0 = 0
|
||||
6:11/0 = 0
|
||||
7:11/0 = 0
|
||||
9:11/0 = 0
|
||||
10:11/0 = 0
|
||||
12:11/0 = 0
|
||||
13:11/0 = 0
|
||||
8:12/0 = 0
|
||||
9:12/0 = 0
|
||||
10:12/0 = 0
|
||||
11:12/0 = 0
|
||||
6:13/0 = 0
|
||||
7:13/0 = 0
|
||||
8:13/0 = 0
|
||||
9:13/0 = 0
|
||||
10:13/0 = 0
|
||||
11:13/0 = 0
|
||||
12:13/0 = 0
|
||||
13:13/0 = 0
|
||||
6:14/0 = 0
|
||||
7:14/0 = 0
|
||||
8:14/0 = 0
|
||||
9:14/0 = 0
|
||||
10:14/0 = 0
|
||||
11:14/0 = 0
|
||||
12:14/0 = 0
|
||||
13:14/0 = 0
|
||||
6:15/0 = 0
|
||||
7:15/0 = 0
|
||||
8:15/0 = 0
|
||||
9:15/0 = 0
|
||||
10:15/0 = 0
|
||||
11:15/0 = 0
|
||||
12:15/0 = 0
|
||||
13:15/0 = 0
|
||||
11:1/0 = 0
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u6jqb"]
|
||||
texture = ExtResource("2_mucy5")
|
||||
texture_region_size = Vector2i(96, 96)
|
||||
|
|
@ -72,7 +193,180 @@ texture_region_size = Vector2i(96, 96)
|
|||
10:9/0 = 0
|
||||
11:9/0 = 0
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_evanm"]
|
||||
texture = ExtResource("1_u6jqb")
|
||||
texture_region_size = Vector2i(128, 128)
|
||||
1:1/0 = 0
|
||||
1:2/0 = 0
|
||||
1:3/0 = 0
|
||||
2:1/0 = 0
|
||||
3:1/0 = 0
|
||||
3:2/0 = 0
|
||||
3:3/0 = 0
|
||||
2:3/0 = 0
|
||||
5:1/0 = 0
|
||||
5:2/0 = 0
|
||||
5:3/0 = 0
|
||||
6:1/0 = 0
|
||||
6:2/0 = 0
|
||||
6:3/0 = 0
|
||||
7:1/0 = 0
|
||||
7:2/0 = 0
|
||||
7:3/0 = 0
|
||||
9:1/0 = 0
|
||||
9:3/0 = 0
|
||||
9:4/0 = 0
|
||||
11:1/0 = 0
|
||||
12:1/0 = 0
|
||||
13:1/0 = 0
|
||||
9:5/0 = 0
|
||||
6:7/0 = 0
|
||||
5:7/0 = 0
|
||||
5:8/0 = 0
|
||||
7:8/0 = 0
|
||||
7:9/0 = 0
|
||||
6:9/0 = 0
|
||||
8:9/0 = 0
|
||||
7:10/0 = 0
|
||||
5:10/0 = 0
|
||||
5:11/0 = 0
|
||||
6:11/0 = 0
|
||||
8:11/0 = 0
|
||||
9:11/0 = 0
|
||||
9:10/0 = 0
|
||||
9:8/0 = 0
|
||||
9:7/0 = 0
|
||||
8:7/0 = 0
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_nsnhs"]
|
||||
texture = ExtResource("1_u6jqb")
|
||||
texture_region_size = Vector2i(96, 96)
|
||||
1:1/0 = 0
|
||||
2:1/0 = 0
|
||||
3:1/0 = 0
|
||||
4:1/0 = 0
|
||||
5:1/0 = 0
|
||||
6:1/0 = 0
|
||||
7:1/0 = 0
|
||||
8:1/0 = 0
|
||||
9:1/0 = 0
|
||||
10:1/0 = 0
|
||||
12:1/0 = 0
|
||||
13:1/0 = 0
|
||||
14:1/0 = 0
|
||||
15:1/0 = 0
|
||||
16:1/0 = 0
|
||||
17:1/0 = 0
|
||||
18:1/0 = 0
|
||||
1:2/0 = 0
|
||||
2:2/0 = 0
|
||||
3:2/0 = 0
|
||||
4:2/0 = 0
|
||||
5:2/0 = 0
|
||||
6:2/0 = 0
|
||||
7:2/0 = 0
|
||||
8:2/0 = 0
|
||||
9:2/0 = 0
|
||||
10:2/0 = 0
|
||||
12:2/0 = 0
|
||||
13:2/0 = 0
|
||||
14:2/0 = 0
|
||||
15:2/0 = 0
|
||||
16:2/0 = 0
|
||||
17:2/0 = 0
|
||||
18:2/0 = 0
|
||||
1:3/0 = 0
|
||||
2:3/0 = 0
|
||||
4:3/0 = 0
|
||||
5:3/0 = 0
|
||||
6:3/0 = 0
|
||||
7:3/0 = 0
|
||||
8:3/0 = 0
|
||||
9:3/0 = 0
|
||||
10:3/0 = 0
|
||||
1:4/0 = 0
|
||||
2:4/0 = 0
|
||||
3:4/0 = 0
|
||||
4:4/0 = 0
|
||||
5:4/0 = 0
|
||||
6:4/0 = 0
|
||||
7:4/0 = 0
|
||||
8:4/0 = 0
|
||||
9:4/0 = 0
|
||||
10:4/0 = 0
|
||||
12:4/0 = 0
|
||||
13:4/0 = 0
|
||||
1:5/0 = 0
|
||||
2:5/0 = 0
|
||||
3:5/0 = 0
|
||||
4:5/0 = 0
|
||||
5:5/0 = 0
|
||||
6:5/0 = 0
|
||||
7:5/0 = 0
|
||||
8:5/0 = 0
|
||||
9:5/0 = 0
|
||||
10:5/0 = 0
|
||||
12:5/0 = 0
|
||||
13:5/0 = 0
|
||||
12:6/0 = 0
|
||||
13:6/0 = 0
|
||||
12:7/0 = 0
|
||||
13:7/0 = 0
|
||||
6:9/0 = 0
|
||||
7:9/0 = 0
|
||||
8:9/0 = 0
|
||||
9:9/0 = 0
|
||||
10:9/0 = 0
|
||||
11:9/0 = 0
|
||||
12:9/0 = 0
|
||||
13:9/0 = 0
|
||||
6:10/0 = 0
|
||||
7:10/0 = 0
|
||||
8:10/0 = 0
|
||||
9:10/0 = 0
|
||||
10:10/0 = 0
|
||||
11:10/0 = 0
|
||||
12:10/0 = 0
|
||||
13:10/0 = 0
|
||||
6:11/0 = 0
|
||||
7:11/0 = 0
|
||||
9:11/0 = 0
|
||||
10:11/0 = 0
|
||||
12:11/0 = 0
|
||||
13:11/0 = 0
|
||||
8:12/0 = 0
|
||||
9:12/0 = 0
|
||||
10:12/0 = 0
|
||||
11:12/0 = 0
|
||||
6:13/0 = 0
|
||||
7:13/0 = 0
|
||||
8:13/0 = 0
|
||||
9:13/0 = 0
|
||||
10:13/0 = 0
|
||||
11:13/0 = 0
|
||||
12:13/0 = 0
|
||||
13:13/0 = 0
|
||||
6:14/0 = 0
|
||||
7:14/0 = 0
|
||||
8:14/0 = 0
|
||||
9:14/0 = 0
|
||||
10:14/0 = 0
|
||||
11:14/0 = 0
|
||||
12:14/0 = 0
|
||||
13:14/0 = 0
|
||||
6:15/0 = 0
|
||||
7:15/0 = 0
|
||||
8:15/0 = 0
|
||||
9:15/0 = 0
|
||||
10:15/0 = 0
|
||||
11:15/0 = 0
|
||||
12:15/0 = 0
|
||||
13:15/0 = 0
|
||||
|
||||
[resource]
|
||||
tile_size = Vector2i(96, 96)
|
||||
sources/1 = SubResource("TileSetAtlasSource_u6jqb")
|
||||
sources/2 = SubResource("TileSetAtlasSource_wtljp")
|
||||
sources/0 = SubResource("TileSetAtlasSource_h7jxu")
|
||||
sources/3 = SubResource("TileSetAtlasSource_evanm")
|
||||
sources/4 = SubResource("TileSetAtlasSource_nsnhs")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,245 @@
|
|||
[gd_resource type="TileSet" load_steps=5 format=3 uid="uid://bt25n4i5s2bkj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ntm66vo10u2q" path="res://_asset/ksw/tile/tile.png" id="1_jwfln"]
|
||||
[ext_resource type="Texture2D" uid="uid://cchtbbig85jcm" path="res://_asset/ksw/tile/tile02.png" id="2_5i20m"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_i03by"]
|
||||
texture = ExtResource("1_jwfln")
|
||||
texture_region_size = Vector2i(128, 128)
|
||||
1:1/0 = 0
|
||||
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, 64, -48, 64, 48, 48, 48, 48, 64, -48, 64)
|
||||
2:1/0 = 0
|
||||
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -48, 64, -48, 64, 48, -64, 48)
|
||||
3:1/0 = 0
|
||||
3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -48, 48, -48, 48, 64, -48, 64, -48, 48, -64, 48)
|
||||
3:2/0 = 0
|
||||
3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -64, 48, -64, 48, 64, -48, 64)
|
||||
3:3/0 = 0
|
||||
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -64, 48, -64, 48, 48, -64, 48, -64, -48, -48, -48)
|
||||
2:3/0 = 0
|
||||
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(64, -48, 64, 48, -64, 48, -64, -48)
|
||||
1:3/0 = 0
|
||||
1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(64, -48, 64, 48, -48, 48, -48, -64, 48, -64, 48, -48)
|
||||
1:2/0 = 0
|
||||
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -64, 48, -64, 48, 64)
|
||||
6:1/0 = 0
|
||||
6:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -48, 64, -48, 64, 64, -64, 64)
|
||||
5:2/0 = 0
|
||||
5:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -64, 64, -64, 64, 64, -48, 64)
|
||||
5:1/0 = 0
|
||||
5:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, 64, -48, 64, 64, -48, 64)
|
||||
6:2/0 = 0
|
||||
6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 64, -64, 64, 64, -64, 64)
|
||||
6:3/0 = 0
|
||||
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 64, -64, 64, 48, -64, 48)
|
||||
5:3/0 = 0
|
||||
5:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -64, 64, -64, 64, 48, -48, 48)
|
||||
7:3/0 = 0
|
||||
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 48, -64, 48, 48, -64, 48)
|
||||
7:2/0 = 0
|
||||
7:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 48, -64, 48, 64, -64, 64)
|
||||
7:1/0 = 0
|
||||
7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -48, 48, -48, 48, 64, -64, 64)
|
||||
9:1/0 = 0
|
||||
9:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, 48, -48, 48, 48, -48, 48)
|
||||
11:1/0 = 0
|
||||
11:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, 64, -48, 64, 48, -48, 48)
|
||||
12:1/0 = 0
|
||||
12:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -48, 64, -48, 64, 48, -64, 48)
|
||||
13:1/0 = 0
|
||||
13:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -48, 48, -48, 48, 48, -64, 48)
|
||||
9:3/0 = 0
|
||||
9:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 48, -48, 48, 64)
|
||||
9:4/0 = 0
|
||||
9:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -64, 48, -64, 48, 64)
|
||||
9:5/0 = 0
|
||||
9:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 48, -64, 48, 48)
|
||||
1:4/0 = 0
|
||||
1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -48, 64, -48, 64, 48)
|
||||
2:4/0 = 0
|
||||
2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -64, 48, -64, -48, 64, -48, 64, 48, 48, 48, 48, 64, -48, 64)
|
||||
3:4/0 = 0
|
||||
3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 48, -64, -48, 48, -48, 48, 48)
|
||||
2:5/0 = 0
|
||||
2:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 48, -64, 48, 48)
|
||||
2:6/0 = 0
|
||||
2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 48, -48, 48, 64)
|
||||
2:7/0 = 0
|
||||
2:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 48, -64, -48, -48, -48, -48, -64, 48, -64, 48, -48, 64, -48, 64, 48)
|
||||
1:7/0 = 0
|
||||
1:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -48, 64, -48, 64, 48)
|
||||
3:7/0 = 0
|
||||
3:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 48, -64, -48, 48, -48, 48, 48)
|
||||
1:8/0 = 0
|
||||
1:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 48, -48, 48, 64)
|
||||
1:9/0 = 0
|
||||
1:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -64, 48, -64, 48, -48, 64, -48, 64, 48, 48, 48, 48, 64)
|
||||
1:10/0 = 0
|
||||
1:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 48, -64, 48, 48)
|
||||
2:9/0 = 0
|
||||
2:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 48, -64, -48, 48, -48, 48, 48)
|
||||
3:9/0 = 0
|
||||
3:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -48, 64, -48, 64, 48)
|
||||
4:8/0 = 0
|
||||
4:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 48, -48, 48, 64)
|
||||
4:9/0 = 0
|
||||
4:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, 48, -64, 48, -64, -48, -48, -48, -48, -64, 48, -64, 48, 64)
|
||||
4:10/0 = 0
|
||||
4:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 48, -64, 48, 48)
|
||||
5:8/0 = 0
|
||||
5:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 48, -64, 48, 48)
|
||||
5:7/0 = 0
|
||||
5:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 64, -48, 64, 48, 48, 48, 48, 64)
|
||||
6:7/0 = 0
|
||||
6:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 48, -64, -48, 48, -48, 48, 48)
|
||||
8:7/0 = 0
|
||||
8:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -48, 64, -48, 64, 48)
|
||||
9:7/0 = 0
|
||||
9:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -64, 48, -64, -48, 48, -48, 48, 64, -48, 64)
|
||||
9:8/0 = 0
|
||||
9:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -64, 48, -64, 48, 48, -48, 48)
|
||||
7:8/0 = 0
|
||||
7:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, 48, -48, 48, 64, -48, 64)
|
||||
7:9/0 = 0
|
||||
7:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, -48, -64, 48, -64, 48, -48, 64, -48, 64, 48, 47.33333, 48, 48, 64, -48, 64, -48, 48, -64, 48, -64, -48)
|
||||
6:9/0 = 0
|
||||
6:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, -48, 64, -48, 64, 48, -48, 48)
|
||||
8:9/0 = 0
|
||||
8:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, -48, 47.33333, 48, -64, 48, -64, -48)
|
||||
7:10/0 = 0
|
||||
7:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, -64, 47.33333, 48, -48, 48, -48, -64)
|
||||
5:10/0 = 0
|
||||
5:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, -48, 48, 64, -48, 64, -48, -48)
|
||||
6:11/0 = 0
|
||||
6:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, 48, -64, 48, -64, -48, 48, -48)
|
||||
8:11/0 = 0
|
||||
8:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(64, 48, -48, 48, -48, -48, 64, -48)
|
||||
5:11/0 = 0
|
||||
5:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, -48, 64, -48, 64, 48, -48, 48, -48, -64, 48, -64)
|
||||
9:11/0 = 0
|
||||
9:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, 48, -64, 48, -64, -48, -48, -48, -48, -64, 48, -64)
|
||||
9:10/0 = 0
|
||||
9:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(48, 64, -48, 64, -48, -48, 48, -48)
|
||||
11:9/0 = 0
|
||||
11:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -64, 64, -64, 64, 64)
|
||||
11:8/0 = 0
|
||||
11:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 64, -48, 64, 64)
|
||||
11:10/0 = 0
|
||||
11:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 64, -64, 64, 48)
|
||||
12:9/0 = 0
|
||||
12:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 64, -64, 64, 64)
|
||||
12:8/0 = 0
|
||||
12:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -48, -48, -48, -48, -64, 64, -64, 64, 64)
|
||||
12:7/0 = 0
|
||||
12:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 64, -48, -48, 64, -48, 64, 64)
|
||||
13:7/0 = 0
|
||||
13:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -48, 64, -48, 64, 64)
|
||||
14:7/0 = 0
|
||||
14:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -48, 48, -48, 48, 64)
|
||||
13:8/0 = 0
|
||||
13:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 64, -64, 64, 64)
|
||||
13:9/0 = 0
|
||||
13:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 64, -64, 64, 64)
|
||||
13:10/0 = 0
|
||||
13:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 64, -64, 64, 64)
|
||||
13:11/0 = 0
|
||||
13:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 64, -64, 64, 48, -64, 48)
|
||||
12:10/0 = 0
|
||||
12:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -64, 48, -64, -64, 64, -64, 64, 64, -48, 64)
|
||||
12:11/0 = 0
|
||||
12:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(-48, 48, -48, -64, 64, -64, 64, 48)
|
||||
14:8/0 = 0
|
||||
14:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 48, -64, 48, -48, 64, -48, 64, 64)
|
||||
14:9/0 = 0
|
||||
14:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 64, -64, 64, 64)
|
||||
14:10/0 = 0
|
||||
14:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 64, -64, 64, 48, 48, 48, 48, 64, -64, 64)
|
||||
14:11/0 = 0
|
||||
14:11/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 48, -64, 48, 48, -64, 48)
|
||||
15:9/0 = 0
|
||||
15:9/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -64, 48, -64, 48, 64)
|
||||
15:10/0 = 0
|
||||
15:10/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, -64, 48, -64, 48, 48, -64, 48)
|
||||
15:8/0 = 0
|
||||
15:8/0/physics_layer_0/polygon_0/points = PackedVector2Array(-64, 64, -64, -48, 48, -48, 48, 64)
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ekrk0"]
|
||||
texture = ExtResource("2_5i20m")
|
||||
texture_region_size = Vector2i(128, 128)
|
||||
1:1/0 = 0
|
||||
2:1/0 = 0
|
||||
3:1/0 = 0
|
||||
4:1/0 = 0
|
||||
2:2/0 = 0
|
||||
3:2/0 = 0
|
||||
2:3/0 = 0
|
||||
3:3/0 = 0
|
||||
3:4/0 = 0
|
||||
3:5/0 = 0
|
||||
3:6/0 = 0
|
||||
3:7/0 = 0
|
||||
3:8/0 = 0
|
||||
2:8/0 = 0
|
||||
2:7/0 = 0
|
||||
2:6/0 = 0
|
||||
2:5/0 = 0
|
||||
2:4/0 = 0
|
||||
1:4/0 = 0
|
||||
4:4/0 = 0
|
||||
1:7/0 = 0
|
||||
4:7/0 = 0
|
||||
5:7/0 = 0
|
||||
6:7/0 = 0
|
||||
7:7/0 = 0
|
||||
8:7/0 = 0
|
||||
6:6/0 = 0
|
||||
7:6/0 = 0
|
||||
7:8/0 = 0
|
||||
6:8/0 = 0
|
||||
6:0/0 = 0
|
||||
6:1/0 = 0
|
||||
6:2/0 = 0
|
||||
6:3/0 = 0
|
||||
7:2/0 = 0
|
||||
8:2/0 = 0
|
||||
9:2/0 = 0
|
||||
9:3/0 = 0
|
||||
8:1/0 = 0
|
||||
9:0/0 = 0
|
||||
9:1/0 = 0
|
||||
7:1/0 = 0
|
||||
11:1/0 = 0
|
||||
12:1/0 = 0
|
||||
12:2/0 = 0
|
||||
11:2/0 = 0
|
||||
10:2/0 = 0
|
||||
13:2/0 = 0
|
||||
11:3/0 = 0
|
||||
10:4/0 = 0
|
||||
11:4/0 = 0
|
||||
12:4/0 = 0
|
||||
10:5/0 = 0
|
||||
11:5/0 = 0
|
||||
12:5/0 = 0
|
||||
12:6/0 = 0
|
||||
11:6/0 = 0
|
||||
10:6/0 = 0
|
||||
11:7/0 = 0
|
||||
13:4/0 = 0
|
||||
14:4/0 = 0
|
||||
15:4/0 = 0
|
||||
15:5/0 = 0
|
||||
15:6/0 = 0
|
||||
14:6/0 = 0
|
||||
13:6/0 = 0
|
||||
13:5/0 = 0
|
||||
14:5/0 = 0
|
||||
14:3/0 = 0
|
||||
14:7/0 = 0
|
||||
|
||||
[resource]
|
||||
tile_size = Vector2i(128, 128)
|
||||
physics_layer_0/collision_layer = 4
|
||||
physics_layer_0/collision_mask = 0
|
||||
sources/3 = SubResource("TileSetAtlasSource_ekrk0")
|
||||
sources/2 = SubResource("TileSetAtlasSource_i03by")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_resource type="TileSet" format=3 uid="uid://doepkfp83k0lb"]
|
||||
[gd_resource type="TileSet" load_steps=4 format=3 uid="uid://doepkfp83k0lb"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://doxhsab56pe50" path="res://_asset/all.png" id="1_26tvm"]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const _DEBUG_TOOL := preload("res://addons/reedcamera/scripts/camera_tools/DeadZ
|
|||
|
||||
@export_group("Follow")
|
||||
@export var enabled_follow: bool = true
|
||||
@export var follow_speed: float = 10000.0 # 世界单位 / 秒
|
||||
@export var follow_speed: float = 600.0 # 世界单位 / 秒
|
||||
@export var follow_lerp := 0.12 # 0~1,越大越“跟手”,越小越“蔚蓝感”的滞后
|
||||
@export_subgroup("Follow Dynamic Speed")
|
||||
@export var min_speed_scale := 0.4 # 贴近死区时
|
||||
|
|
|
|||
|
|
@ -1,17 +1,30 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://ddwoxlqluxiq5"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://ddwoxlqluxiq5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvxgviq7l64ck" path="res://addons/reedcomponent/grap_hook/garpping_hook_v_2.gd" id="1_jrg4x"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_2bmkq"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_jrg4x"]
|
||||
radius = 5.0990195
|
||||
|
||||
[node name="GarppingHookV2" type="Node2D"]
|
||||
script = ExtResource("1_jrg4x")
|
||||
min_length = 900.0
|
||||
max_length = 1200.0
|
||||
stretching_speed = 5000.0
|
||||
max_speed = 5600.0
|
||||
retract_speed = 7000.0
|
||||
|
||||
[node name="Line2D" type="Line2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
points = PackedVector2Array(0, 0, 80, 0)
|
||||
width = 8.0
|
||||
width = 50.0
|
||||
|
||||
[node name="ShapeCast2D" type="ShapeCast2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
shape = SubResource("CircleShape2D_2bmkq")
|
||||
target_position = Vector2(80, 0)
|
||||
collision_mask = 20
|
||||
|
||||
[node name="RayCast2D" type="RayCast2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
|
|
|||
|
|
@ -1,20 +1,27 @@
|
|||
class_name Hook
|
||||
extends Node2D
|
||||
|
||||
@onready var line_2d: Line2D = %Line2D
|
||||
@onready var shape_cast_2d: ShapeCast2D = %ShapeCast2D
|
||||
@onready var tip_detector: Area2D = $TipDetector
|
||||
## ================
|
||||
## Export Field
|
||||
## ================
|
||||
##钩爪最短长度
|
||||
@export var min_length := 140.0
|
||||
##钩爪最大长度
|
||||
@export var max_length := 200.0
|
||||
##钩爪伸出速度
|
||||
@export var stretching_speed: float = 1400.0
|
||||
## 最大速度上限
|
||||
@export var max_speed: float = 800.0
|
||||
|
||||
@export_category("Hook Retract")
|
||||
@export var retract_speed: float = 1800.0
|
||||
|
||||
@onready var line_2d: Line2D = %Line2D
|
||||
@onready var ray: RayCast2D = %RayCast2D
|
||||
@onready var tip_detector: Area2D = $TipDetector
|
||||
|
||||
## 钩爪当前速度
|
||||
var _current_velocity: Vector2 = Vector2.ZERO
|
||||
var _tween: Tween
|
||||
|
||||
const GRAPABLE_GROUP = &"GRAPABLE"
|
||||
|
|
@ -40,8 +47,8 @@ var _dir_id: int = -1
|
|||
# =================
|
||||
|
||||
func _ready() -> void:
|
||||
ray.enabled = true
|
||||
ray.target_position = Vector2.ZERO
|
||||
shape_cast_2d.enabled = true
|
||||
shape_cast_2d.target_position = Vector2.ZERO
|
||||
|
||||
## 初始化
|
||||
func init(hook_comp: SpawnHookComponet, reset_to_target: bool) -> void:
|
||||
|
|
@ -100,10 +107,6 @@ func _process(_delta: float) -> void:
|
|||
# Core Logic
|
||||
# =================
|
||||
|
||||
## 钩爪当前速度
|
||||
var _current_velocity: Vector2 = Vector2.ZERO
|
||||
## 最大速度上限
|
||||
@export var max_speed: float = 800.0
|
||||
|
||||
func _update_stretching(delta: float) -> void:
|
||||
# 检测前端点的吸引力 (direction, strength)
|
||||
|
|
@ -134,17 +137,17 @@ func _update_stretching(delta: float) -> void:
|
|||
|
||||
tip_detector.global_position = predicted_pos
|
||||
|
||||
# RayCast 也应该射到“累计长度”
|
||||
ray.target_position = velocity_dir * next_length
|
||||
ray.force_raycast_update()
|
||||
# ShapeCast2D 也应该射到"累计长度"
|
||||
shape_cast_2d.target_position = velocity_dir * next_length
|
||||
shape_cast_2d.force_shapecast_update()
|
||||
|
||||
# ===== 命中檢測(最高優先)=====
|
||||
if ray.is_colliding():
|
||||
var collider := ray.get_collider()
|
||||
if shape_cast_2d.is_colliding():
|
||||
var collider := shape_cast_2d.get_collider(0)
|
||||
if collider is Node2D and collider.is_in_group(GRAPABLE_GROUP):
|
||||
var hit_pos := ray.get_collision_point()
|
||||
var hit_pos := shape_cast_2d.get_collision_point(0)
|
||||
_current_length = global_position.distance_to(hit_pos)
|
||||
ray.target_position = velocity_dir * _current_length
|
||||
shape_cast_2d.target_position = velocity_dir * _current_length
|
||||
_handle_hit(collider as Node2D, hit_pos)
|
||||
return
|
||||
|
||||
|
|
@ -190,7 +193,7 @@ func _handle_hit(target: Node2D, hit_pos: Vector2) -> void:
|
|||
_stretching_dir = Vector2.ZERO
|
||||
_current_velocity = Vector2.ZERO # 重置速度
|
||||
|
||||
ray.target_position = to_local(hit_pos)
|
||||
shape_cast_2d.target_position = to_local(hit_pos)
|
||||
|
||||
# 如果 target 有 on_hook_hit 方法,调用它(传入钩爪实例)
|
||||
if target.has_method(&"on_hook_hit"):
|
||||
|
|
@ -218,8 +221,8 @@ func _release_hook() -> void:
|
|||
_anchor.queue_free()
|
||||
_anchor = null
|
||||
|
||||
# 3. 重置 Ray 與 Line(視覺清乾淨)
|
||||
ray.target_position = Vector2.ZERO
|
||||
# 3. 重置 ShapeCast2D 與 Line(視覺清乾淨)
|
||||
shape_cast_2d.target_position = Vector2.ZERO
|
||||
_update_line()
|
||||
|
||||
func release_hook_with_transition(has_trans: bool) -> void:
|
||||
|
|
@ -242,7 +245,7 @@ func release_hook_with_transition(has_trans: bool) -> void:
|
|||
_anchor = null
|
||||
|
||||
# 当前末端位置(本地坐标)
|
||||
var start_pos: Vector2 = ray.target_position
|
||||
var start_pos: Vector2 = shape_cast_2d.target_position
|
||||
var distance := start_pos.length()
|
||||
|
||||
if distance <= 0.001:
|
||||
|
|
@ -260,7 +263,7 @@ func release_hook_with_transition(has_trans: bool) -> void:
|
|||
_tween.set_ease(Tween.EASE_IN)
|
||||
|
||||
_tween.tween_property(
|
||||
ray,
|
||||
shape_cast_2d,
|
||||
"target_position",
|
||||
Vector2.ZERO,
|
||||
duration
|
||||
|
|
@ -273,9 +276,9 @@ func release_hook_with_transition(has_trans: bool) -> void:
|
|||
func _update_line() -> void:
|
||||
if _anchor and is_instance_valid(_anchor):
|
||||
# 关键:锚点是世界坐标固定的,把它换算到 Hook 的本地坐标
|
||||
ray.target_position = to_local(_anchor.global_position)
|
||||
shape_cast_2d.target_position = to_local(_anchor.global_position)
|
||||
|
||||
line_2d.set_point_position(1, ray.target_position)
|
||||
line_2d.set_point_position(1, shape_cast_2d.target_position)
|
||||
|
||||
func _create_anchor_on_node(target: Node2D, hit_global_pos: Vector2) -> Node2D:
|
||||
if _anchor and is_instance_valid(_anchor):
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ class_name LocomotionComponent extends ComponentBase
|
|||
##空中控制乘量,在空中移动时修改
|
||||
@export var air_control_mult : float = .65
|
||||
#基础的乘量,对所有Character相同
|
||||
const GRAVITY_BASIC_MULT_FACTOR : float = 1.8
|
||||
const GRAVITY_BASIC_MULT_FACTOR : float = 18
|
||||
#下坠速度和最大下坠速度的阈值,超过了这个阈值会开启下坠速度修正,主要取决于设备的刷新率固写死。
|
||||
const FALL_SPEED_EXCEED_TOLERANCE_THRESHOLD = 40
|
||||
|
||||
@export_category("Locomotion Properties")
|
||||
@export_subgroup("Move")
|
||||
##如果为true,则使用加速度逐渐达到目标速度;如果为false,则直接设置速度
|
||||
@export var use_acceleration: bool = true
|
||||
##存在輸入時,向最大移動輸入運動的加速度
|
||||
@export var run_accel : float = 1200
|
||||
##不存在輸入時,向Vector.ZERO運動的加速度
|
||||
|
|
@ -124,12 +126,16 @@ func _update_movement(delta : float) -> void:
|
|||
|
||||
var applyed_air_control = 1 if characterbody.is_on_floor() else air_control_mult
|
||||
var target_move_speed = move_speed_max * input_dir
|
||||
|
||||
characterbody.velocity.x = speed_approach(
|
||||
characterbody.velocity.x,
|
||||
target_move_speed,
|
||||
applyed_air_control * accel * delta
|
||||
)
|
||||
|
||||
if use_acceleration:
|
||||
characterbody.velocity.x = speed_approach(
|
||||
characterbody.velocity.x,
|
||||
target_move_speed,
|
||||
applyed_air_control * accel * delta
|
||||
)
|
||||
else:
|
||||
# 直接设置速度,无加速度
|
||||
characterbody.velocity.x = target_move_speed
|
||||
|
||||
#检测是否这帧开始了移动
|
||||
_check_is_start_move()
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
<Project Sdk="Godot.NET.Sdk/4.6.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net9.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<RootNamespace>godotplateformer</RootNamespace>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
@ -8,15 +8,11 @@
|
|||
|
||||
config_version=5
|
||||
|
||||
[animation]
|
||||
|
||||
compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
||||
|
||||
[application]
|
||||
|
||||
config/name="godot-plateformer"
|
||||
run/main_scene="uid://3vc8ojbiyy5w"
|
||||
config/features=PackedStringArray("4.6", "C#", "Forward Plus")
|
||||
run/main_scene="uid://x041oerqe1iu"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
|
@ -28,16 +24,10 @@ ReedCameraSystem="*res://addons/reedcamera/scripts/ReedCameraGlobal.gd"
|
|||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=640
|
||||
window/size/viewport_height=360
|
||||
window/size/window_width_override=1920
|
||||
window/size/window_height_override=1080
|
||||
window/size/viewport_width=1920
|
||||
window/size/viewport_height=1080
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="godot-plateformer"
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/reedcamera/plugin.cfg", "res://addons/reedcomponent/plugin.cfg", "res://addons/reedfx/plugin.cfg", "res://addons/reedinput/plugin.cfg", "res://addons/reedscene/plugin.cfg")
|
||||
|
|
|
|||