胖子游戏吃肉

This commit is contained in:
cakipaul 2025-08-05 23:07:35 +08:00
parent e4176f4e24
commit f1450a8a6c
7 changed files with 116 additions and 19 deletions

View File

@ -4699,7 +4699,7 @@ animations = [{
"duration": 1.0,
"texture": ExtResource("1013_osfe2")
}],
"loop": true,
"loop": false,
"name": &"c03_胖子游戏_吃东西",
"speed": 6.0
}, {

View File

@ -81,5 +81,5 @@ unique_name_in_owner = true
light_mask = 9
scale = Vector2(0.5, 0.5)
sprite_frames = ExtResource("2_3w63u")
animation = &"c00_吕萍_idle_right"
animation = &"c03_胖子游戏_吃东西"
offset = Vector2(0, -100)

View File

@ -206,7 +206,8 @@ var ANIMATION_CONFIG = {
MOVEMENT_RUNNING: [&"", &"c03_胖子游戏_瘦子跑"],
5: [&"c03_胖子游戏_掉下来", Vector2.ONE, Vector2(0, -51.0)],
6: [&"c03_胖子游戏_洞里爬出来", Vector2.ONE, Vector2(-70, -44.5)],
7: [&"c03_胖子游戏_胖子对半砍", Vector2.ONE, Vector2(0, -51.0)],
7: [&"", Vector2.ONE, Vector2(0, -51.0), &"", &"c03_胖子游戏_胖子对半砍"],
8: [&"", Vector2.ONE, Vector2(0, -51.0), &"", &"c03_胖子游戏_吃东西"],
},
"小小小蝶":
{

View File

@ -53,7 +53,7 @@ func _on_ground_ready() -> void:
#0: 初始化; 1-3 三关
var current_stage := 0
var aiming_duration := 1.5
var aiming_duration := 1.8
# 1.0s 一次
func _on_chop_timer_timeout() -> void:
@ -72,17 +72,17 @@ func _on_chop_timer_timeout() -> void:
var next_x = player_pos.x + player.velocity.x * aiming_duration + randf_range(10.0, 50.0)
monster_target.global_position.x = clampf(next_x, s_range.x, s_range.y)
await Util.wait(0.5)
next_x = player_pos.x + player.velocity.x * aiming_duration + randf_range(50.0, 200.0)
next_x = player_pos.x + player.velocity.x * aiming_duration + sign(player.velocity.x) * randf_range(0.0, 40.0)
monster_target.global_position.x = clampf(next_x, s_range.x, s_range.y)
elif current_stage == 3:
# 越来越快
aiming_duration = clampf(aiming_duration - 0.1, 1.0, 3.0)
aiming_duration = clampf(aiming_duration - 0.1, 1.2, 3.0)
chop_timer.wait_time = aiming_duration + 0.5
monster.chop_right(aiming_duration)
var next_x = player_pos.x + player.velocity.x * aiming_duration + randf_range(0.0, 50.0)
monster_target.global_position.x = clampf(next_x, s_range.x, s_range.y)
await Util.wait(0.5)
next_x = player_pos.x + player.velocity.x * aiming_duration + randf_range(30.0, 100.0)
next_x = player_pos.x + player.velocity.x * aiming_duration + randf_range(-20.0, 20.0)
monster_target.global_position.x = clampf(next_x, s_range.x, s_range.y)
if GlobalConfig.DEBUG:
print("棺材怪 chop next_x=", monster_target.global_position.x, "s_range=", s_range)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=36 format=3 uid="uid://clgwc3jcqarpe"]
[gd_scene load_steps=37 format=3 uid="uid://clgwc3jcqarpe"]
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_0c2p2"]
[ext_resource type="Script" uid="uid://cs4ddcjq81c1d" path="res://scene/ground/scene/c03/s10_胖子游戏1.gd" id="2_tthij"]
@ -29,6 +29,7 @@
[ext_resource type="SpriteFrames" uid="uid://cay6bn3elw2we" path="res://asset/art/gif/c03_胖子游戏/c03_胖子游戏第一段/c03_胖子游戏第一段_frames.tres" id="18_f57cq"]
[ext_resource type="Texture2D" uid="uid://vw03vgq281a8" path="res://asset/art/gif/c03_胖子游戏/c03_胖子游戏第一段/落点1.png" id="18_js8ld"]
[ext_resource type="FontFile" uid="uid://bnxdsxp7dst7f" path="res://asset/font/锐字太空混元像素简繁-闪 超黑_mianfeiziti.com.ttf" id="19_usr2w"]
[ext_resource type="Texture2D" uid="uid://cylsq5cvhlp18" path="res://asset/art/tool/point_light.png" id="20_4gg56"]
[ext_resource type="Texture2D" uid="uid://0qkxvm0xiubu" path="res://asset/art/gif/c03_胖子游戏/c03_胖子游戏第一段/落点2.png" id="20_whxhi"]
[sub_resource type="AnimationLibrary" id="AnimationLibrary_k01ve"]
@ -269,6 +270,13 @@ theme_override_fonts/font = ExtResource("19_usr2w")
theme_override_font_sizes/font_size = 20
text = "[wave]文字文字文字文字[/wave]"
[node name="PointLight2D2" type="PointLight2D" parent="Ground/AmbientLayer" index="0"]
position = Vector2(201, -184)
energy = 0.5
range_layer_min = -5
texture = ExtResource("20_4gg56")
texture_scale = 2.0
[node name="MainPlayer" parent="Ground" index="5"]
position = Vector2(396, 98)
character = "胖子游戏"

View File

@ -30,11 +30,35 @@ func _on_ground_ready() -> void:
var rect := Rect2i(0, -158, int(right_x) + 320, 316)
SceneManager.get_camera_marker().apply_limits(rect)
# 处理 Ambush肉1 节点
for i in range(1, 4):
var node = get_node("../DeployLayer/Ambush肉" + str(i)) as Ambush2D
if node.played:
node.hide()
_disable_wall_on_meat(node)
else:
node.triggered.connect(_on_eat_meat_triggered.bind(node))
func _disable_wall_on_meat(meat_node) -> void:
meat_node.get_node("StaticBody2D/CollisionShape2D").disabled = true
func _on_eat_meat_triggered(node) -> void:
_disable_wall_on_meat(node)
var player = SceneManager.get_player()
SceneManager.lock_player(0, 8)
var tween = create_tween()
tween.tween_interval(0.9)
tween.tween_property(node, "modulate:a", 0.0, 1.0)
await player.animation_finished
SceneManager.unlock_player()
func eat_meat() -> void:
var light_pivot = $"../DeployLayer/LightPivot"
SceneManager.lock_player()
$"../DeployLayer/Ambush吃肉".enabled = false
$"../DeployLayer/Ambush最终吃肉".enabled = false
var x = $"../DeployLayer/Pro吃肉".global_position.x
await SceneManager.get_player().walk_to_x(x).finished
# 第一帧没有瘦子,后面才有
@ -54,4 +78,3 @@ func collapse() -> void:
$"Sfx山塌了".play()
#TODO
SceneManager.pop_debug_dialog_info("音效", "山塌了")

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=3 uid="uid://cxabqg87g4vxc"]
[gd_scene load_steps=22 format=3 uid="uid://cxabqg87g4vxc"]
[ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_ly8ge"]
[ext_resource type="Script" uid="uid://f4uampm47832" path="res://scene/ground/scene/c03/s12_胖子游戏3.gd" id="2_c01lu"]
@ -104,13 +104,15 @@ _data = {
&"eat_meat": SubResource("Animation_c01lu")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y18rp"]
[node name="S12" type="Node2D"]
metadata/_edit_horizontal_guides_ = [-627.0]
metadata/_edit_horizontal_guides_ = [-627.0, 103.0]
[node name="Ground" parent="." instance=ExtResource("1_ly8ge")]
scene_name = "c03_s12"
display_hud = false
player_y = 63
player_y = 55
footstep_type = "胖子游戏"
[node name="AnimationPlayer" parent="Ground" index="0"]
@ -155,24 +157,87 @@ script = ExtResource("9_vyyx8")
autostart = false
metadata/_custom_type_script = "uid://cphfob11f7atx"
[node name="Ambush吃肉" parent="Ground/DeployLayer" index="3" instance=ExtResource("11_sul0a")]
[node name="Ambush肉1" parent="Ground/DeployLayer" index="3" instance=ExtResource("11_sul0a")]
position = Vector2(923, 85)
texture = ExtResource("14_vyyx8")
offset = Vector2(13, 0)
trigger_mode = "interact"
[node name="StaticBody2D" type="StaticBody2D" parent="Ground/DeployLayer/Ambush肉1"]
position = Vector2(3, 1)
collision_layer = 2
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/Ambush肉1/StaticBody2D"]
shape = SubResource("RectangleShape2D_y18rp")
[node name="Ambush肉2" parent="Ground/DeployLayer" index="4" instance=ExtResource("11_sul0a")]
position = Vector2(1443, 84)
texture = ExtResource("12_mr0pm")
offset = Vector2(20, 0)
trigger_mode = "interact"
[node name="StaticBody2D" type="StaticBody2D" parent="Ground/DeployLayer/Ambush肉2"]
position = Vector2(3, 1)
collision_layer = 2
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/Ambush肉2/StaticBody2D"]
shape = SubResource("RectangleShape2D_y18rp")
[node name="Ambush肉3" parent="Ground/DeployLayer" index="5" instance=ExtResource("11_sul0a")]
position = Vector2(2016, 85)
texture = ExtResource("15_7x1vi")
offset = Vector2(37, 0)
trigger_mode = "interact"
collision_width_and_x = Vector2(44.19, 0)
[node name="StaticBody2D" type="StaticBody2D" parent="Ground/DeployLayer/Ambush肉3"]
position = Vector2(3, 1)
collision_layer = 2
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Ground/DeployLayer/Ambush肉3/StaticBody2D"]
shape = SubResource("RectangleShape2D_y18rp")
[node name="Ambush最终吃肉" parent="Ground/DeployLayer" index="6" instance=ExtResource("11_sul0a")]
position = Vector2(3639, 54)
sign_mark_offset = Vector2(39, -9)
trigger_mode = "interact"
one_shot = false
hook_method = "eat_meat"
[node name="Ambush小孩山塌了" parent="Ground/DeployLayer" index="4" instance=ExtResource("11_sul0a")]
position = Vector2(2688, 1)
[node name="Ambush小孩山塌了" parent="Ground/DeployLayer" index="7" instance=ExtResource("11_sul0a")]
position = Vector2(3016, -7)
sign_mark_offset = Vector2(39, -9)
one_shot = false
hook_method = "collapse"
[node name="LightPivot" type="Marker2D" parent="Ground/DeployLayer" index="5"]
[node name="LightPivot" type="Marker2D" parent="Ground/DeployLayer" index="8"]
position = Vector2(850, 95)
[node name="AmbushLabel1" parent="Ground/DeployLayer" index="9" instance=ExtResource("11_sul0a")]
position = Vector2(707, 29)
[node name="太瘦弱" type="Label" parent="Ground/DeployLayer/AmbushLabel1"]
offset_left = -18.0
offset_top = -19.0
offset_right = 22.0
offset_bottom = -5.0
text = "太瘦弱了"
[node name="AmbushLabel2" parent="Ground/DeployLayer" index="10" instance=ExtResource("11_sul0a")]
position = Vector2(2524, 4)
[node name="保平安" type="Label" parent="Ground/DeployLayer/AmbushLabel2"]
offset_left = -18.0
offset_top = -19.0
offset_right = 22.0
offset_bottom = -5.0
text = "浇洒髫年血,将她交给我,方能保你平安"
[node name="MainPlayer" parent="Ground" index="5"]
position = Vector2(69, 95)
position = Vector2(69, 103)
character = "胖子游戏"
player_movement_rect = Rect2(30, -158, 820, 316)
facing_direction = Vector2(1, 0)
@ -227,7 +292,7 @@ layer = -1
[node name="山前地后" type="ParallaxLayer" parent="Ground/ParallaxBackground2"]
[node name="小孩山塌了" type="AnimatedSprite2D" parent="Ground/ParallaxBackground2/山前地后"]
position = Vector2(2686, -56)
position = Vector2(3000, -56)
sprite_frames = ExtResource("10_7x1vi")
animation = &"小孩山塌了"
script = ExtResource("9_vyyx8")