feat: Implement core player movement with advanced pushing mechanics, define game modes, and introduce various new managers and UI components.

This commit is contained in:
Yogi Wiguna
2026-03-11 09:56:10 +08:00
parent 884ce60cf1
commit 4b7a64a119
25 changed files with 65 additions and 76 deletions
+2
View File
@@ -1,6 +1,8 @@
extends Node
class_name BotController
# BotController - Standalone modular bot AI system (no Beehave dependency)
# Handles all bot decision-making: movement, grabbing, putting, arranging, and sabotage
+2
View File
@@ -1,6 +1,8 @@
extends RefCounted
class_name BotStrategicPlanner
# BotStrategicPlanner - Strategic decision-making for bot AI
# Evaluates tile needs, pathfinding targets, and sabotage opportunities
+2 -1
View File
@@ -1,4 +1,5 @@
class_name GameMode extends RefCounted
extends RefCounted
class_name GameMode
enum Mode {
FREEMODE = 0,
+8 -8
View File
@@ -143,10 +143,10 @@ func _get_device_id() -> String:
# Try to load saved device ID for consistent guest identity
var id_file := "user://device_id.txt"
if FileAccess.file_exists(id_file):
var file := FileAccess.open(id_file, FileAccess.READ)
if file:
var saved_id := file.get_as_text().strip_edges()
file.close()
var file_read := FileAccess.open(id_file, FileAccess.READ)
if file_read:
var saved_id := file_read.get_as_text().strip_edges()
file_read.close()
if not saved_id.is_empty():
return saved_id
@@ -156,10 +156,10 @@ func _get_device_id() -> String:
device_id = str(randi()) + str(Time.get_ticks_msec())
# Save for future use
var file := FileAccess.open(id_file, FileAccess.WRITE)
if file:
file.store_string(device_id)
file.close()
var file_write := FileAccess.open(id_file, FileAccess.WRITE)
if file_write:
file_write.store_string(device_id)
file_write.close()
return device_id
@@ -1,5 +1,7 @@
extends Node
# CameraContextManager - Smoothly follows player and clamps to arena edges
var camera: Camera3D
+2
View File
@@ -1,5 +1,7 @@
extends Node
# LobbyManager - Manages room/lobby state across scenes
# Signals
+1 -1
View File
@@ -38,7 +38,7 @@ const MESSAGES = {
"USED_SPECIAL_POWER": "Used a special power!"
}
static func send_message(target: Node, message: String, type: int = MessageType.NORMAL):
static func send_message(target: Node, message: String, _type: int = MessageType.NORMAL):
if is_instance_valid(target) and target.has_method("rpc"):
# Check if the text is empty, do nothing
if message.is_empty():
+6
View File
@@ -1,5 +1,7 @@
extends Node
var player: Node3D
var movement_manager: Node
var race_manager: Node
@@ -98,6 +100,10 @@ func handle_unhandled_input(event):
var mode = LobbyManager.get_game_mode()
var is_sng = mode == GameMode.Mode.STOP_N_GO
# Safety check for SettingsManager
if not SettingsManager:
return
# Get dynamic keybinds
var key_p1 = SettingsManager.get_control_keycode("powerup_1")
var key_p2 = SettingsManager.get_control_keycode("powerup_2")
@@ -1,5 +1,7 @@
extends Node
var player: Node3D
var enhanced_gridmap: Node
+2
View File
@@ -1,5 +1,7 @@
extends Node
# PlayerboardManager - Handles all playerboard operations including grab, put, arrange
var player: Node3D
@@ -1,5 +1,7 @@
extends Node
# SpecialTilesManager - Handles special effects triggered by holo tile pickups
# Holo tile indices (11-14) trigger special effects
+2 -2
View File
@@ -31,8 +31,8 @@ func _ready() -> void:
auth.auth_completed.connect(_on_auth_completed)
auth.logged_out.connect(_on_logged_out)
func _on_auth_completed(_success: bool, user_data: Dictionary) -> void:
if _success:
func _on_auth_completed(success: bool, _user_data: Dictionary) -> void:
if success:
await load_profile()
func _on_logged_out() -> void:
+3 -1
View File
@@ -1,5 +1,7 @@
class_name ScarcityModel
extends RefCounted
class_name ScarcityModel
# ScarcityModel - Data definitions for tile scarcity
+5 -5
View File
@@ -162,11 +162,11 @@ func _load_existing_patches() -> void:
var patches: Array[String] = []
dir.list_dir_begin()
var file := dir.get_next()
while file != "":
if file.ends_with(".pck"):
patches.append(file)
file = dir.get_next()
var patch_file := dir.get_next()
while patch_file != "":
if patch_file.ends_with(".pck"):
patches.append(patch_file)
patch_file = dir.get_next()
dir.list_dir_end()
# Sort patches by version (filename includes version)
+8
View File
@@ -1,5 +1,7 @@
extends Control
# PowerUpInventoryUI - Displays stored powerups and handles selection
# UI References
@@ -146,6 +148,12 @@ func _update_btn_shortcut(effect_id: int, btn: Button):
var is_sng = mode == GameMode.Mode.STOP_N_GO
var key_text = ""
# Safety check for SettingsManager (Autoload)
if not SettingsManager:
sc_lbl.text = ""
return
if is_sng:
match effect_id:
0: key_text = SettingsManager.get_control_text("powerup_1")
+4 -2
View File
@@ -26,7 +26,9 @@ var listening_action: String = "" # Set when waiting for a keypress
func _ready():
# Theme inheritance is broken by CanvasLayer root, no need for theme = null
_load_ui_values()
_connect_signals()
if SettingsManager:
_connect_signals()
# Initial visibility
visible = false
@@ -165,7 +167,7 @@ func _update_all_key_labels():
func _update_key_label(action_name: String):
var btn = get_node_or_null("%" + action_name.to_pascal_case() + "Btn")
if btn:
if btn and SettingsManager:
btn.text = SettingsManager.get_control_text(action_name)
btn.modulate = Color.WHITE