feat: Implement Tekton Doors game mode with portal mechanics, add an in-game message bar, and introduce a pre-game countdown.

This commit is contained in:
Yogi Wiguna
2026-02-25 16:58:59 +08:00
parent a157c1efc4
commit 6d41f9dbc6
9 changed files with 513 additions and 8 deletions
+14 -5
View File
@@ -82,6 +82,7 @@ var is_player_moving: bool = false:
set(value): if movement_manager: movement_manager.is_moving = value
var _verify_timer: float = 0.0
var _movement_tween: Tween = null
var can_finish: bool:
get: return race_manager.can_finish if race_manager else false
set(value): if race_manager: race_manager.can_finish = value
@@ -1307,9 +1308,11 @@ func start_movement_along_path(path: Array, clear_visual: bool = true):
if global_position.distance_squared_to(start_world_pos) > 0.001:
global_position = start_world_pos
var tween = create_tween()
tween.set_trans(Tween.TRANS_LINEAR)
tween.set_ease(Tween.EASE_IN_OUT)
if _movement_tween:
_movement_tween.kill()
_movement_tween = create_tween()
_movement_tween.set_trans(Tween.TRANS_LINEAR)
_movement_tween.set_ease(Tween.EASE_IN_OUT)
var step_duration = 0.25
if movement_manager:
@@ -1317,12 +1320,13 @@ func start_movement_along_path(path: Array, clear_visual: bool = true):
for point in path:
# Use global_position for consistency
tween.tween_property(self , "global_position", grid_to_world(Vector2i(point.x, point.y)), step_duration)
_movement_tween.tween_property(self , "global_position", grid_to_world(Vector2i(point.x, point.y)), step_duration)
tween.tween_callback(func():
_movement_tween.tween_callback(func():
var old_pos = current_position
current_position = Vector2i(path[-1].x, path[-1].y)
is_player_moving = false
_movement_tween = null
target_position = Vector2i(-1, -1)
print("[Player] %s finished move. %s -> %s" % [name, old_pos, current_position])
@@ -1937,6 +1941,11 @@ func set_spawn_position(pos: Vector2i):
print("[Player %s] set_spawn_position: Grid %s -> World %s (CellSize: %s)" % [name, pos, new_pos, cell_size])
if _movement_tween:
_movement_tween.kill()
_movement_tween = null
is_player_moving = false
global_position = new_pos
target_visual_position = new_pos