feat: Implement the Stop 'n' Go game mode, including phase management, player missions, movement penalties, and associated player movement logic.
This commit is contained in:
@@ -244,14 +244,11 @@ func _apply_arena_setup():
|
||||
# Spawn tiles for missions
|
||||
if multiplayer.is_server():
|
||||
_spawn_mission_tiles()
|
||||
# Client already constructs the base arena locally via _apply_arena_setup()
|
||||
# So no need to blast huge 5KB arrays across the network.
|
||||
|
||||
# Sync the WHOLE grid to all clients to ensure size and stripes are correct
|
||||
var main = get_node("/root/Main")
|
||||
if main and can_rpc():
|
||||
# Gather all floor 0 and floor 1 data
|
||||
var floor0_data = gridmap.get_floor_data(0)
|
||||
var floor1_data = gridmap.get_floor_data(1)
|
||||
main.rpc("sync_full_grid_data_stop_n_go", floor0_data, floor1_data, gridmap.columns, gridmap.rows)
|
||||
# For any specifically spawned tiles (like missions), they are sent individually
|
||||
# by sync_grid_item inside _spawn_mission_tiles.
|
||||
|
||||
func _spawn_mission_tiles():
|
||||
var gridmap = get_node("/root/Main/EnhancedGridMap")
|
||||
@@ -270,6 +267,9 @@ func _spawn_mission_tiles():
|
||||
if (floor_item == TILE_WALKABLE or floor_item == TILE_SAFE):
|
||||
if gridmap.get_cell_item(Vector3i(x, 1, z)) == -1:
|
||||
gridmap.set_cell_item(Vector3i(x, 1, z), tile_type)
|
||||
var main = get_node("/root/Main")
|
||||
if main and can_rpc():
|
||||
main.rpc("sync_grid_item", x, 1, z, tile_type)
|
||||
count += 1
|
||||
|
||||
func _assign_missions():
|
||||
|
||||
Reference in New Issue
Block a user