Rescaled maps and reworked drone code

Rescaled maps and reworked drone code to support fpv remote and joy controller with a menu switch
This commit is contained in:
2025-02-15 22:31:27 -05:00
parent bad3fe6f1e
commit 6b85034a30
11 changed files with 133 additions and 824 deletions

View File

@@ -5,9 +5,10 @@ extends Node3D
@export var current_camera: int = 0
@export var game_started: bool = false
@export var is_paused: bool = false
@export var controller_mode: String = "JoyController"
func _process(delta):
func _process(_delta):
if camera_array.size() != 0 and Input.is_action_just_released("change_camera_view"):
current_camera += 1
if current_camera <= camera_array.size() - 1:

View File

@@ -11,7 +11,7 @@ func _ready():
child_camera = get_child(0)
func _physics_process(delta):
func _physics_process(_delta):
look_at(drone.global_position)
dist_to_drone = global_position.distance_to(drone.global_position)

View File

@@ -2,6 +2,9 @@ extends Control
@export var start_button: Button
@export var quit_button: Button
@export var controller_mode_button: CheckButton
@export var joy_controller_label: Label
@export var fpv_remote_label: Label
func _ready():
@@ -23,3 +26,14 @@ func _on_quit_button_pressed():
func _on_visibility_changed() -> void:
if visible:
start_button.grab_focus()
func _on_controller_mode_button_toggled(toggled_on):
if toggled_on:
GameManager.controller_mode = "FPVRemote"
joy_controller_label.self_modulate = Color(0.5, 0.5, 0.5, 1.0)
fpv_remote_label.self_modulate = Color(0.0, 1.0, 0.0, 1.0)
elif !toggled_on:
GameManager.controller_mode = "JoyController"
joy_controller_label.self_modulate = Color(0.0, 1.0, 0.0, 1.0)
fpv_remote_label.self_modulate = Color(0.5, 0.5, 0.5, 1.0)

View File

@@ -20,7 +20,7 @@ func _on_quit_button_pressed():
get_tree().quit()
func _input(event: InputEvent) -> void:
func _input(_event: InputEvent) -> void:
if Input.is_action_just_pressed("start") and !GameManager.is_paused and GameManager.game_started:
_toggle_pause_state(true)
elif Input.is_action_just_pressed("start") and GameManager.is_paused: