feat: Implement the new Stop N Go game mode with dedicated managers, models, and UI.

This commit is contained in:
Yogi Wiguna
2026-02-26 11:29:58 +08:00
parent 3cd67c02ab
commit c57b045bef
7 changed files with 36 additions and 24 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ current = true
fov = 35.5
[node name="Camera3D200" type="Camera3D" parent="." unique_id=1763366951]
transform = Transform3D(1, 0, 0, 0, 0.5077037, 0.86153173, 0, -0.86153173, 0.5077037, 9, 19.636, 22.5)
transform = Transform3D(1, 0, 0, 0, 0.5077037, 0.86153173, 0, -0.86153173, 0.5077037, 7, 32.3, 25.8)
environment = ExtResource("4_ky38j")
current = true
fov = 21.0
@@ -70,6 +70,8 @@ func _update_camera_target():
if LobbyManager.game_mode == "Stop n Go":
_update_stop_n_go_camera(current_row, current_col)
elif LobbyManager.game_mode == "Tekton Doors":
_update_tekton_doors_camera()
else:
_update_freemode_camera(current_row, current_col)
@@ -122,6 +124,12 @@ func _update_stop_n_go_camera(current_row: int, current_col: int):
_apply_camera_tween(Vector3(target_x, target_y, target_z))
func _update_tekton_doors_camera():
# --- TEKTON DOORS: Static Overlook ---
# Grid is 14x14, center is approx (7, 7)
# User requested position: Vector3(7.0, 31.0, 25.5)
_apply_camera_tween(Vector3(7.0, 32.3, 25.8))
func _update_freemode_camera(current_row: int, current_col: int):
# --- FREEMODE: 3x3 Grid ---
# Zone thresholds 4, 9
+6 -6
View File
@@ -90,22 +90,22 @@ func handle_unhandled_input(event):
if event is InputEventKey and event.pressed and not event.echo:
match event.keycode:
KEY_KP_1, KEY_1, KEY_KP_2, KEY_2, KEY_KP_3, KEY_3, KEY_KP_4, KEY_4:
var is_sng = LobbyManager.game_mode == "Stop n Go"
var is_restricted = LobbyManager.game_mode == "Stop n Go" or LobbyManager.game_mode == "Tekton Doors"
match event.keycode:
KEY_KP_1, KEY_1:
player.activate_powerup(0) # FASTER_SPEED
KEY_KP_2, KEY_2:
if is_sng:
player.activate_powerup(1) # AREA_FREEZE (StopNGo)
if is_restricted:
player.activate_powerup(1) # AREA_FREEZE (Restricted)
else:
player.activate_powerup(2) # BLOCK_FLOOR (Free)
KEY_KP_3, KEY_3:
if is_sng:
player.activate_powerup(3) # INVISIBLE_MODE (StopNGo)
if is_restricted:
player.activate_powerup(3) # INVISIBLE_MODE (Restricted)
else:
player.activate_powerup(1) # AREA_FREEZE (Free)
KEY_KP_4, KEY_4:
if not is_sng:
if not is_restricted:
player.activate_powerup(3) # INVISIBLE_MODE (Free)
# KEY_R:
# player.auto_put_item()
+3 -2
View File
@@ -461,8 +461,9 @@ func spawn_powerups_around(center: Vector2i, force_powerups: bool = true):
if rng.randf() < 0.7:
item_id = rng.randi_range(7, 10)
else:
# 30% Chance for PowerUp (Exclude Wall 13 only in Stop n Go)
if LobbyManager.game_mode == "Stop n Go":
# 30% Chance for PowerUp (Speed 11, Freeze 12, Ghost 14 - Exclude Wall 13 in restricted modes)
var is_restricted = LobbyManager.game_mode == "Stop n Go" or LobbyManager.game_mode == "Tekton Doors"
if is_restricted:
item_id = [11, 12, 14].pick_random()
else:
item_id = rng.randi_range(11, 14)
+1 -1
View File
@@ -11,7 +11,7 @@ enum Phase {GO, STOP}
const GO_DURATION: float = 8.0
const STOP_DURATION: float = 4.0
const REQUIRED_GOALS: int = 1
const REQUIRED_GOALS: int = 8
var current_phase: Phase = Phase.GO
var phase_timer: float = GO_DURATION
+8 -8
View File
@@ -10,17 +10,17 @@ const TILE_STAR = 9
const TILE_COIN = 10
# Special tiles (Holo)
const TILE_BURN = 11
const TILE_SPAWN = 12
const TILE_FREEZE = 13
const TILE_BLOCK = 14
const TILE_SPEED = 11
const TILE_FREEZE = 12
const TILE_WALL = 13
const TILE_INVISIBLE = 14
const STANDARD_TILES = [
TILE_HEART, TILE_DIAMOND, TILE_STAR, TILE_COIN
]
const SPECIAL_TILES = [
TILE_BURN, TILE_SPAWN, TILE_FREEZE, TILE_BLOCK
TILE_SPEED, TILE_FREEZE, TILE_WALL, TILE_INVISIBLE
]
# Weights (higher = more common)
@@ -50,10 +50,10 @@ static func get_tile_weights() -> Dictionary:
weights[tile] = STANDARD_WEIGHT
# Special tiles
var is_sng = LobbyManager.game_mode == "Stop n Go"
var is_restricted = LobbyManager.game_mode == "Stop n Go" or LobbyManager.game_mode == "Tekton Doors"
for tile in SPECIAL_TILES:
if is_sng and tile == TILE_FREEZE:
continue # Hide Wall Block only in Stop n Go
if is_restricted and tile == TILE_WALL:
continue # Hide Wall Block only in restricted modes
weights[tile] = special_weight
return weights
+9 -6
View File
@@ -31,8 +31,10 @@ func _ready():
_setup_btn(1, container.get_node_or_null("FreezeAreaBtn"))
var wall_btn = container.get_node_or_null("WallBtn")
_setup_btn(2, wall_btn)
if wall_btn and LobbyManager.game_mode == "Stop n Go":
wall_btn.visible = false # Hide Wall Power-up only in Stop n Go
var is_restricted = LobbyManager.game_mode == "Stop n Go" or LobbyManager.game_mode == "Tekton Doors"
if wall_btn and is_restricted:
wall_btn.visible = false # Hide Wall Power-up in restricted modes
_setup_btn(3, container.get_node_or_null("GhostBtn"))
print("[PowerUpUI] UI Initialization Complete. Mapped %d buttons." % icon_containers.size())
@@ -107,12 +109,13 @@ func _setup_btn(effect_id: int, btn: Button):
# Determine Label Text based on Effect ID
var key_text = ""
if LobbyManager.game_mode == "Stop n Go":
# Stop n Go Mapping: 1, 2, 3 (No Wall)
var is_restricted = LobbyManager.game_mode == "Stop n Go" or LobbyManager.game_mode == "Tekton Doors"
if is_restricted:
# Restricted Mapping: 1, 2, 3 (No Wall)
match effect_id:
0: key_text = "1"
1: key_text = "2"
3: key_text = "3"
1: key_text = "2" # Freeze is now 2
3: key_text = "3" # Ghost is now 3
else:
# Free Mode Mapping: 1, 2, 3, 4 (Original)
match effect_id: