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
@@ -13,6 +13,7 @@
[ext_resource type="BoxMesh" uid="uid://dy5p77cjb3geo" path="res://addons/enhanced_gridmap/meshlibrary/tile_start.tres" id="9_pgnbl"]
[ext_resource type="Texture2D" uid="uid://dpkx1a780pvwv" path="res://assets/textures/tile_diamond.png" id="10_sx8rm"]
[ext_resource type="BoxMesh" uid="uid://b5cc3prem52r6" path="res://addons/enhanced_gridmap/meshlibrary/tile_freeze.tres" id="11_pgnbl"]
[ext_resource type="BoxMesh" uid="uid://dcjdwbffgtutt" path="res://addons/enhanced_gridmap/meshlibrary/tile_non_walkable.tres" id="11_uwjsj"]
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_5d0gc"]
load_path = "res://.godot/imported/tile_heart.png-deeef50755ca225f028608dfd16900e6.s3tc.ctex"
@@ -21,23 +22,8 @@ load_path = "res://.godot/imported/tile_heart.png-deeef50755ca225f028608dfd16900
resource_name = "boost"
transparency = 1
cull_mode = 2
albedo_color = Color(0.91, 0.91, 0.91, 0.45098)
albedo_texture = SubResource("CompressedTexture2D_5d0gc")
[sub_resource type="ArrayMesh" id="ArrayMesh_r2l4m"]
_surfaces = [{
"aabb": AABB(-0.282176, -0.000324821, -0.282176, 0.564351, 0.050792, 0.564351),
"format": 34896613377,
"index_count": 36,
"index_data": PackedByteArray("BwAEAAUABwAGAAQABQACAAMABQAEAAIAAAAEAAYAAAACAAQABQABAAcABQADAAEAAgABAAMAAgAAAAEAAQAGAAcAAQAAAAYA"),
"name": "boost",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 8,
"vertex_data": PackedByteArray("AAD/////AAAAAP7/AAAAAP///////wAA///+/wAAAAD//wAA//8AAP//AAAAAAAAAAAAAP//AAAAAAAAAAAAAA==")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_pgnbl"]
resource_name = "tile_heart"
_surfaces = [{
@@ -54,13 +40,11 @@ _surfaces = [{
"vertex_data": PackedByteArray("AAD//////78AAP//////vwAA/////6oqAAD+/wAAAAAAAP7/AAD/vwAA/v8AAKoq/////////7//////////v//////////////+/wAAAAD///7/AAD/v////v8AAP////8AAP///7///wAA////P///AAD///////8AAAAAAAD//wAAAAD/P///AAAAAP//AAAAAP///78AAAAA////PwAAAAD//6oqAAAAAAAAAAAAAAAAAAD/PwAAAAAAAKoq/////////39U1VTV/7//v////39U1VTV/////////3//v/9//7//v////3//v/9//////wAA/3//v/9//7//vwAA/3//v/9//////wAA/39U1VTV/7//vwAA/39U1VTV")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_r2l4m")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2vf4e"]
resource_name = "boost"
transparency = 1
cull_mode = 2
albedo_color = Color(0.91, 0.91, 0.91, 0.45098)
albedo_texture = ExtResource("10_sx8rm")
[sub_resource type="ArrayMesh" id="ArrayMesh_r32il"]
@@ -110,6 +94,7 @@ item/3/shapes = []
item/3/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/3/navigation_layers = 1
item/4/name = "non-walkable"
item/4/mesh = ExtResource("11_uwjsj")
item/4/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
item/4/mesh_cast_shadow = 1
item/4/shapes = []
@@ -1,4 +1,5 @@
[gd_resource type="StandardMaterial3D" load_steps=0 format=3 uid="uid://dqhmv78u8iy1d"]
[gd_resource type="StandardMaterial3D" format=3 uid="uid://dqhmv78u8iy1d"]
[resource]
albedo_color = Color(0.310617, 0.310617, 0.310617, 1)
transparency = 1
albedo_color = Color(0.30980393, 0.30980393, 0.30980393, 0)
@@ -1,7 +1,9 @@
[gd_resource type="BoxMesh" format=3 uid="uid://bb3b32qso3yab"]
[ext_resource type="Material" uid="uid://dqhmv78u8iy1d" path="res://addons/enhanced_gridmap/meshlibrary/mat_normal.tres" id="1_4kxai"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_n7oje"]
transparency = 1
albedo_color = Color(0.30980393, 0.30980393, 0.30980393, 0)
[resource]
material = ExtResource("1_4kxai")
material = SubResource("StandardMaterial3D_n7oje")
size = Vector3(1, 0.1, 1)
Binary file not shown.
Binary file not shown.
-16
View File
@@ -7,23 +7,8 @@ load_path = "res://.godot/imported/tile_coin.png-07bdc9862d055beeb72a967a0094a5c
resource_name = "boost"
transparency = 1
cull_mode = 2
albedo_color = Color(0.91, 0.91, 0.91, 0.45098)
albedo_texture = SubResource("CompressedTexture2D_po712")
[sub_resource type="ArrayMesh" id="ArrayMesh_acoqc"]
_surfaces = [{
"aabb": AABB(-0.282176, -0.000324821, -0.282176, 0.564351, 0.050792, 0.564351),
"format": 34896613377,
"index_count": 36,
"index_data": PackedByteArray("BwAEAAUABwAGAAQABQACAAMABQAEAAIAAAAEAAYAAAACAAQABQABAAcABQADAAEAAgABAAMAAgAAAAEAAQAGAAcAAQAAAAYA"),
"name": "boost",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 8,
"vertex_data": PackedByteArray("AAD/////AAAAAP7/AAAAAP///////wAA///+/wAAAAD//wAA//8AAP//AAAAAAAAAAAAAP//AAAAAAAAAAAAAA==")
}]
blend_shape_mode = 0
[resource]
resource_name = "tile_diamond"
_surfaces = [{
@@ -40,4 +25,3 @@ _surfaces = [{
"vertex_data": PackedByteArray("AAD//////78AAP//////vwAA/////6oqAAD+/wAAAAAAAP7/AAD/vwAA/v8AAKoq/////////7//////////v//////////////+/wAAAAD///7/AAD/v////v8AAP////8AAP///7///wAA////P///AAD///////8AAAAAAAD//wAAAAD/P///AAAAAP//AAAAAP///78AAAAA////PwAAAAD//6oqAAAAAAAAAAAAAAAAAAD/PwAAAAAAAKoq/////////39U1VTV/7//v////39U1VTV/////////3//v/9//7//v////3//v/9//////wAA/3//v/9//7//vwAA/3//v/9//////wAA/39U1VTV/7//vwAA/39U1VTV")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_acoqc")
-16
View File
@@ -6,23 +6,8 @@
resource_name = "boost"
transparency = 1
cull_mode = 2
albedo_color = Color(0.91, 0.91, 0.91, 0.45098)
albedo_texture = ExtResource("1_max3p")
[sub_resource type="ArrayMesh" id="ArrayMesh_acoqc"]
_surfaces = [{
"aabb": AABB(-0.282176, -0.000324821, -0.282176, 0.564351, 0.050792, 0.564351),
"format": 34896613377,
"index_count": 36,
"index_data": PackedByteArray("BwAEAAUABwAGAAQABQACAAMABQAEAAIAAAAEAAYAAAACAAQABQABAAcABQADAAEAAgABAAMAAgAAAAEAAQAGAAcAAQAAAAYA"),
"name": "boost",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 8,
"vertex_data": PackedByteArray("AAD/////AAAAAP7/AAAAAP///////wAA///+/wAAAAD//wAA//8AAP//AAAAAAAAAAAAAP//AAAAAAAAAAAAAA==")
}]
blend_shape_mode = 0
[resource]
resource_name = "tile_star"
_surfaces = [{
@@ -39,4 +24,3 @@ _surfaces = [{
"vertex_data": PackedByteArray("AAD//////78AAP//////vwAA/////6oqAAD+/wAAAAAAAP7/AAD/vwAA/v8AAKoq/////////7//////////v//////////////+/wAAAAD///7/AAD/v////v8AAP////8AAP///7///wAA////P///AAD///////8AAAAAAAD//wAAAAD/P///AAAAAP//AAAAAP///78AAAAA////PwAAAAD//6oqAAAAAAAAAAAAAAAAAAD/PwAAAAAAAKoq/////////39U1VTV/7//v////39U1VTV/////////3//v/9//7//v////3//v/9//////wAA/3//v/9//7//vwAA/3//v/9//////wAA/39U1VTV/7//vwAA/39U1VTV")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_acoqc")
+1 -1
View File
@@ -21,7 +21,7 @@ config/icon="res://icon.svg"
[autoload]
SettingsManager="*uid://c1ouaaqnn0lrc"
SettingsManager="*res://scripts/managers/settings_manager.gd"
Nakama="*uid://bueyqhhvxe0tx"
NakamaManager="*res://scripts/nakama_manager.gd"
AuthManager="*res://scripts/managers/auth_manager.gd"
+2 -2
View File
@@ -196,7 +196,7 @@ func _ready():
var bot_id = name.to_int()
var bot_names = ["Bot", "Alpha", "Beta", "Gamma", "Delta"]
var name_idx = (bot_id - 1) % bot_names.size()
display_name = "%s %d" % ["Bot", bot_id]
display_name = "%s %d" % [bot_names[name_idx], bot_id]
else:
# Humans get name from Lobby
for player_data in LobbyManager.get_players():
@@ -486,7 +486,7 @@ func sync_special_animation() -> void:
# =============================================================================
@rpc("any_peer", "call_local", "reliable")
func trigger_screen_shake(shake_type: String) -> void:
func trigger_screen_shake(_shake_type: String) -> void:
# Shake disabled by user request. Camera movement now handled by CameraContextManager.
pass
+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