feat: implement Stop N Go arena, animation system, and lobby manager features

This commit is contained in:
Yogi Wiguna
2026-03-30 15:06:21 +08:00
parent 52d9b4bffb
commit 42e96a7ed9
45 changed files with 1110 additions and 79 deletions
+11
View File
@@ -3,6 +3,8 @@ extends Control
@onready var animated_sprite_2d: AnimatedSprite2D = $StopPhase/AnimatedSprite2D
@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var count_down_animation: AnimatedSprite2D = $CountDown/CountDownAnimation
@onready var go_finish: Control = $GoFinish
@onready var go_animation_2d: AnimatedSprite2D = $GoFinish/GoAnimation2D
#func _input(event: InputEvent) -> void:
#if event.is_action_pressed("grab_item"):
@@ -28,3 +30,12 @@ func play_countdown_30s():
func play_countdown_15s():
count_down_animation.play("15s")
func play_go_animation():
animation_player.play("go_animation")
func play_go_finish_animation():
if go_finish:
go_finish.visible = true
if go_animation_2d:
go_animation_2d.play("go_animation")
+72 -1
View File
@@ -156,6 +156,58 @@ tracks/11/keys = {
"values": [true]
}
[sub_resource type="Animation" id="Animation_go_loop"]
resource_name = "go_animation"
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ReadyGo/TextureRect:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0.75, 0.75), Vector2(0.9, 0.9), Vector2(0.75, 0.75)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ReadyGo/TextureRect:texture")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [ExtResource("27_t05ex")]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("ReadyGo/TextureRect:pivot_offset")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(375, 231)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("ReadyGo:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_bbp28"]
resource_name = "ready-go"
length = 4.0
@@ -332,6 +384,7 @@ tracks/4/keys = {
[sub_resource type="AnimationLibrary" id="AnimationLibrary_emg7w"]
_data = {
&"RESET": SubResource("Animation_pfi5j"),
&"go_animation": SubResource("Animation_go_loop"),
&"ready-go": SubResource("Animation_bbp28"),
&"safe-zone-appear": SubResource("Animation_2hrhd"),
&"stop-phase": SubResource("Animation_i0235")
@@ -457,12 +510,30 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="CountDownAnimation" type="AnimatedSprite2D" parent="CountDown" unique_id=1053910485]
position = Vector2(683, 360)
scale = Vector2(0.75, 0.75)
sprite_frames = ExtResource("24_u10lt")
animation = &"15s"
animation = &"go_animation"
[node name="GoFinish" type="Control" parent="." unique_id=1244747969]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="GoAnimation2D" type="AnimatedSprite2D" parent="GoFinish" unique_id=1419741041]
position = Vector2(927, 360)
scale = Vector2(0.78, 0.59833336)
sprite_frames = ExtResource("24_u10lt")
animation = &"go_animation"
frame_progress = 0.30336955
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1614214519]
libraries/ = SubResource("AnimationLibrary_emg7w")
Binary file not shown.
+17
View File
@@ -350,6 +350,18 @@ func _ready():
if LobbyManager.get_randomize_spawn() and not spawn_point_selected:
visible = false
@onready var floor_spawn_bot: AnimatedSprite3D = $floor_spawn_bot
@onready var floor_spawn_top: AnimatedSprite3D = $floor_spawn_top
func _input(event: InputEvent) -> void:
if event.is_action_pressed("grab_item"):
floor_spawn_bot.play("floor_spawn_bot")
floor_spawn_top.play("floor_spawn_top")
func play_floor_spawn():
floor_spawn_bot.play("floor_spawn_bot")
floor_spawn_top.play("floor_spawn_top")
func _init_managers():
movement_manager = load("res://scripts/managers/player_movement_manager.gd").new()
movement_manager.name = "MovementManager"
@@ -549,6 +561,11 @@ func sync_special_animation() -> void:
"""Sync special ability animation across network."""
play_special_animation()
@rpc("any_peer", "call_local", "reliable")
func sync_floor_spawn_animation() -> void:
"""Sync floor spawn animation across network."""
play_floor_spawn()
# =============================================================================
# Skill VFX
# =============================================================================
+16 -1
View File
@@ -76,7 +76,7 @@ uppercase = true
autowrap_mode = 2
[node name="Position" type="Label3D" parent="." unique_id=482425681]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.83275956, 1.5372815, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.537, 0)
billboard = 1
modulate = Color(0.32, 0.614667, 1, 1)
text = "1st"
@@ -144,6 +144,21 @@ billboard = 1
sprite_frames = ExtResource("10_y4r1p")
animation = &"wall-initiator"
[node name="floor_spawn_top" type="AnimatedSprite3D" parent="." unique_id=248195140]
transform = Transform3D(0.5, 0, 0, 0, -0.5, -7.54979e-08, 0, 7.54979e-08, -0.5, 0, 1.4714267, 0.02553294)
visible = false
billboard = 1
sprite_frames = ExtResource("10_y4r1p")
animation = &"floor_spawn_top"
frame = 23
frame_progress = 1.0
[node name="floor_spawn_bot" type="AnimatedSprite3D" parent="." unique_id=169253263]
transform = Transform3D(1.2, 0, 0, 0, -5.2453668e-08, -1.2, 0, 1.2, -5.2453668e-08, 0, -0.506722, -4.4299043e-08)
visible = false
sprite_frames = ExtResource("10_y4r1p")
animation = &"floor_spawn_bot"
[node name="receiver_skill_stunned" type="AnimatedSprite3D" parent="." unique_id=56953581]
transform = Transform3D(0.5, 0, 0, 0, -2.1855694e-08, -0.5, 0, 0.5, -2.1855694e-08, 0, 1.5653763, 0)
visible = false