feat: Implement new Stop 'n' Go game mode with dedicated manager, player logic, and control scripts.
This commit is contained in:
+51
-1
@@ -191,12 +191,62 @@ func _process(delta):
|
||||
global_position = carrier.global_position + Vector3(0, 1.5, 0)
|
||||
rotation = carrier.rotation
|
||||
|
||||
_update_prompt_label()
|
||||
|
||||
var mesh_cache: Array[MeshInstance3D] = []
|
||||
var original_scales: Array[Vector3] = []
|
||||
var prompt_label: Label3D
|
||||
@onready var SettingsManager = get_node_or_null("/root/SettingsManager")
|
||||
|
||||
func _update_prompt_label():
|
||||
if not prompt_label: return
|
||||
|
||||
if is_static_turret or is_carried or is_thrown or is_recovering:
|
||||
prompt_label.visible = false
|
||||
return
|
||||
|
||||
var authority_player = null
|
||||
var players = get_tree().get_nodes_in_group("Players")
|
||||
for p in players:
|
||||
if p.name == str(multiplayer.get_unique_id()):
|
||||
authority_player = p
|
||||
break
|
||||
|
||||
if not authority_player:
|
||||
prompt_label.visible = false
|
||||
return
|
||||
|
||||
# Check distance
|
||||
var player_pos = Vector2(authority_player.current_position.x, authority_player.current_position.y)
|
||||
var tekton_pos = Vector2(current_position.x, current_position.y)
|
||||
if player_pos.distance_to(tekton_pos) > 1.5:
|
||||
prompt_label.visible = false
|
||||
return
|
||||
|
||||
# Check power bar
|
||||
var pw_mgr = authority_player.get_node_or_null("PowerUpManager")
|
||||
if pw_mgr and pw_mgr.current_boost >= (pw_mgr.MAX_BOOST - 1):
|
||||
prompt_label.visible = true
|
||||
else:
|
||||
prompt_label.visible = false
|
||||
|
||||
func _ready():
|
||||
# Cache meshes and their initial scales
|
||||
_cache_meshes(self )
|
||||
_cache_meshes(self)
|
||||
|
||||
prompt_label = Label3D.new()
|
||||
var shortcut_text = "G"
|
||||
if SettingsManager and SettingsManager.has_method("get_control_text"):
|
||||
shortcut_text = SettingsManager.get_control_text("tekton_grab")
|
||||
prompt_label.text = "[ " + str(shortcut_text) + " ]"
|
||||
prompt_label.font_size = 64
|
||||
prompt_label.outline_size = 12
|
||||
prompt_label.billboard = BaseMaterial3D.BILLBOARD_ENABLED
|
||||
prompt_label.no_depth_test = true
|
||||
prompt_label.position = Vector3(0, 1.8, 0)
|
||||
prompt_label.modulate = Color(1.0, 0.9, 0.0) # Yellow text
|
||||
prompt_label.visible = false
|
||||
add_child(prompt_label)
|
||||
|
||||
func _cache_meshes(node: Node):
|
||||
if node is MeshInstance3D:
|
||||
|
||||
Reference in New Issue
Block a user