feat: Implement initial player character, main game scene, 'stop and go' arena, and touch controls.

This commit is contained in:
Yogi Wiguna
2026-03-25 10:50:32 +08:00
parent 7ca63fea00
commit d20dca4b25
9 changed files with 387 additions and 88 deletions
+2 -2
View File
@@ -185,9 +185,9 @@ func _update_stop_timer_visuals():
stop_timer_node.visible = true
if current_phase == Phase.GO:
# GO Phase: All dim unless in last 6 seconds (lights up 6, 4, 2s)
# GO Phase: All dim unless in last 3 seconds (lights up 3, 2, 1s)
for i in range(stop_segments.size()):
var threshold = 6.0 - (i * 2.0)
var threshold = 3.0 - (i * 1.0)
if phase_timer <= threshold:
stop_segments[i].add_theme_stylebox_override("panel", lit_style)
else:
+19 -33
View File
@@ -1,4 +1,4 @@
extends CanvasLayer
extends Control
# TouchControlsManager - Manages mobile touch controls including virtual joystick and action buttons
@@ -102,20 +102,9 @@ func _on_player_child_to_find_powerup(node):
func _create_touch_ui():
print("[TouchControls] Creating/Finding touch UI...")
# Use layer 10 - above regular UI but below pause menu
layer = 10
# Check if container already exists (added in scene)
var container = get_node_or_null("TouchControls")
if not container:
# Create main container if missing
container = Control.new()
container.name = "TouchControls"
container.set_anchors_preset(Control.PRESET_FULL_RECT)
container.mouse_filter = Control.MOUSE_FILTER_PASS # Pass input to children
add_child(container)
else:
print("[TouchControls] Found existing TouchControls container")
var container = self
# Helper to find or create control
var find_or_create_joystick = func():
@@ -149,29 +138,26 @@ func _create_touch_ui():
# --- Actions Containers ---
power_bar_container = container.get_node_or_null("PowerBarBtn")
if not power_bar_container:
power_bar_container = container.get_node_or_null("ActionsBtn") # Fallback
interaction_container = container.get_node_or_null("InteractionBtn")
# Create containers if missing (runtime dynamic creation)
if not power_bar_container:
power_bar_container = Control.new()
power_bar_container.name = "PowerBarBtn"
power_bar_container.set_anchors_preset(Control.PRESET_FULL_RECT)
power_bar_container.mouse_filter = Control.MOUSE_FILTER_PASS
container.add_child(power_bar_container)
else:
print("[TouchControls] Found existing PowerBarBtn container")
if not interaction_container:
interaction_container = Control.new()
interaction_container.name = "InteractionBtn"
interaction_container.set_anchors_preset(Control.PRESET_FULL_RECT)
interaction_container.mouse_filter = Control.MOUSE_FILTER_PASS
container.add_child(interaction_container)
else:
print("[TouchControls] Found existing InteractionBtn container")
#if not power_bar_container:
#power_bar_container = Control.new()
#power_bar_container.name = "PowerBarBtn"
#power_bar_container.set_anchors_preset(Control.PRESET_FULL_RECT)
#power_bar_container.mouse_filter = Control.MOUSE_FILTER_PASS
#container.add_child(power_bar_container)
#else:
#print("[TouchControls] Found existing PowerBarBtn container")
#
#if not interaction_container:
#interaction_container = Control.new()
#interaction_container.name = "InteractionBtn"
#interaction_container.set_anchors_preset(Control.PRESET_FULL_RECT)
#interaction_container.mouse_filter = Control.MOUSE_FILTER_PASS
#container.add_child(interaction_container)
#else:
#print("[TouchControls] Found existing InteractionBtn container")
# Style/Align Containers
if power_bar_container is BoxContainer: