feat: Introduce the Stop N Go game mode, including its manager script, arena assets, and associated HUD elements.

This commit is contained in:
Yogi Wiguna
2026-03-13 10:32:25 +08:00
parent 6242c4e37e
commit 877a238a82
18 changed files with 2523 additions and 13 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ var player: Node3D
# Bounds Definitions { min_x, max_x, min_z, max_z }
var bounds_freemode = { "min_x": 3.0, "max_x": 11.0, "min_z": 15.0, "max_z": 22.5 }
var bounds_stop_n_go = { "min_x": 3.0, "max_x": 18.5, "min_z": 15.0, "max_z": 17.5 }
var bounds_stop_n_go = { "min_x": 3.0, "max_x": 19.5, "min_z": 15.0, "max_z": 19.5 }
var bounds_doors = { "min_x": 7.0, "max_x": 7.0, "min_z": 25.8, "max_z": 25.8 } # Static overlook
func initialize(p_camera: Camera3D, _p_shake_manager: Node):
+27 -11
View File
@@ -36,7 +36,7 @@ var phase_timer: float = 15.0 # Initialized dynamically later
var is_active: bool = false
var player_missions: Dictionary = {} # player_id -> {target_tile: int, required: int, current: int}
var finish_line_x: int = 21 # Right side of the map for win condition
var finish_line_x: int = 22 # Right side of the map for win condition
# Tile IDs
const TILE_WALKABLE = 0
@@ -291,7 +291,7 @@ func _setup_arena():
@rpc("authority", "call_remote", "reliable")
func sync_arena_setup():
print("[StopNGo] Client: Syncing Arena Setup (22x10)...")
print("[StopNGo] Client: Syncing Arena Setup (23x12)...")
_apply_arena_setup()
func _apply_arena_setup():
@@ -303,8 +303,8 @@ func _apply_arena_setup():
if not gridmap: return
# Set Size for Stop n Go explicitly, bypassing setters that wipe the map
gridmap.set("columns", 22)
gridmap.set("rows", 10)
gridmap.set("columns", 23)
gridmap.set("rows", 12)
# Clear existing items on all layers
gridmap.clear()
@@ -312,16 +312,32 @@ func _apply_arena_setup():
# Dynamic Safe Zone: No static safe columns anymore
# Safe zone spawns randomly during gameplay
var non_walkable_coords = [
Vector2i(0,0), Vector2i(1,0), Vector2i(2,0), Vector2i(3,0), Vector2i(4,0), Vector2i(5,0), Vector2i(6,0), Vector2i(7,0), Vector2i(8,0), Vector2i(9,0), Vector2i(10,0), Vector2i(13,0), Vector2i(19,0), Vector2i(20,0), Vector2i(21,0), Vector2i(22,0),
Vector2i(0,1), Vector2i(1,1), Vector2i(2,1), Vector2i(3,1), Vector2i(6,1),
Vector2i(0,2), Vector2i(1,2), Vector2i(2,2), Vector2i(3,2),
Vector2i(17,9), Vector2i(18,9), Vector2i(19,9), Vector2i(20,9), Vector2i(21,9), Vector2i(22,9),
Vector2i(11,10), Vector2i(12,10), Vector2i(13,10), Vector2i(15,10), Vector2i(16,10), Vector2i(17,10), Vector2i(18,10), Vector2i(19,10), Vector2i(20,10), Vector2i(21,10), Vector2i(22,10),
Vector2i(0,11), Vector2i(4,11), Vector2i(5,11), Vector2i(6,11), Vector2i(9,11), Vector2i(10,11), Vector2i(11,11), Vector2i(12,11), Vector2i(13,11), Vector2i(14,11), Vector2i(15,11), Vector2i(16,11), Vector2i(17,11), Vector2i(18,11), Vector2i(19,11), Vector2i(20,11), Vector2i(21,11), Vector2i(22,11)
]
# Create bands based on X (Horizontal Progress)
for x in range(gridmap.columns):
var tile_id = TILE_WALKABLE
if x == 0:
tile_id = TILE_START
elif x == gridmap.columns - 1:
tile_id = TILE_FINISH
for z in range(gridmap.rows):
var current_pos = Vector2i(x, z)
if current_pos in non_walkable_coords:
gridmap.set_cell_item(Vector3i(x, 0, z), -1) # empty space / void
gridmap.set_cell_item(Vector3i(x, 1, z), TILE_OBSTACLE) # wall block
continue
var tile_id = TILE_WALKABLE
if x == 0:
tile_id = TILE_START
elif x == gridmap.columns - 1:
tile_id = TILE_FINISH
gridmap.set_cell_item(Vector3i(x, 0, z), tile_id)
gridmap.set_cell_item(Vector3i(x, 1, z), -1)
# Note: Specific obstacles removed as per user request to replace with random ones.
# MISSION TILES: Moved to start_game_mode() to ensure they spawn AFTER walls.
@@ -346,7 +362,7 @@ func _spawn_mission_tiles():
if not gridmap: return
# Forbidden Zones (Start, Finish) - No items here
var forbidden_x = [0, 21]
var forbidden_x = [0, gridmap.columns - 1]
# Goal items: Heart(7), Diamond(8), Star(9), Coin(10)
var goal_items = [7, 8, 9, 10]