Fixed critical bugs
This commit is contained in:
@@ -10,7 +10,7 @@ var position : Vector2:
|
||||
get:
|
||||
return ship.position
|
||||
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var input_direction := Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
ship.accelerate(input_direction, delta)
|
||||
|
||||
@@ -8,11 +8,12 @@ extends CharacterBody2D
|
||||
@export var size : Vector2:
|
||||
set(value):
|
||||
size = value
|
||||
if sprite.texture:
|
||||
if sprite and sprite.texture:
|
||||
sprite.texture.size = value
|
||||
colision.shape.radius = 0.9 * minf(size.x, size.y)/2
|
||||
colision.shape.height = 0.9 * maxf(size.x, size.y)
|
||||
colision.rotation = 0.0 if size.x < size.y else PI/2
|
||||
if colision:
|
||||
colision.shape.radius = 0.9 * minf(size.x, size.y)/2
|
||||
colision.shape.height = 0.9 * maxf(size.x, size.y)
|
||||
colision.rotation = 0.0 if size.x < size.y else PI/2
|
||||
get:
|
||||
return size
|
||||
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@ extends Node
|
||||
|
||||
func _ready() -> void:
|
||||
var player : Node = load("res://game/entities/player.tscn").instantiate()
|
||||
player.position = Vector2(100, 100)
|
||||
add_child(player)
|
||||
player.position = Vector2(100, 100)
|
||||
|
||||
+4
-1
@@ -4,8 +4,11 @@ extends Node
|
||||
signal show_main_menu
|
||||
|
||||
|
||||
@onready var main_menu_button := $%MainMenuButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$%MainMenuButton.grab_focus()
|
||||
main_menu_button.grab_focus()
|
||||
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
|
||||
+11
-9
@@ -8,6 +8,8 @@ signal show_options
|
||||
|
||||
|
||||
@onready var continue_button := $%ContinueButton
|
||||
@onready var start_button := $%StartButton
|
||||
@onready var quit_button := $%QuitButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -17,20 +19,20 @@ func _ready() -> void:
|
||||
|
||||
func _init_focus() -> void:
|
||||
if continue_button.disabled:
|
||||
$%StartButton.grab_focus()
|
||||
start_button.grab_focus()
|
||||
else:
|
||||
$%ContinueButton.grab_focus()
|
||||
continue_button.grab_focus()
|
||||
|
||||
|
||||
func _setup_neighbors() -> void:
|
||||
if $%ContinueButton.disabled:
|
||||
$%ContinueButton.focus_neighbor_top = ""
|
||||
$%StartButton.focus_neighbor_top = $%QuitButton.get_path()
|
||||
$%QuitButton.focus_neighbor_bottom = $%StartButton.get_path()
|
||||
if continue_button.disabled:
|
||||
continue_button.focus_neighbor_top = ""
|
||||
start_button.focus_neighbor_top = quit_button.get_path()
|
||||
quit_button.focus_neighbor_bottom = start_button.get_path()
|
||||
else:
|
||||
$%ContinueButton.focus_neighbor_top = $%QuitButton.get_path()
|
||||
$%StartButton.focus_neighbor_top = ""
|
||||
$%QuitButton.focus_neighbor_bottom = $%ContinueButton.get_path()
|
||||
continue_button.focus_neighbor_top = quit_button.get_path()
|
||||
start_button.focus_neighbor_top = ""
|
||||
quit_button.focus_neighbor_bottom = continue_button.get_path()
|
||||
|
||||
|
||||
func _on_continue_button_pressed() -> void:
|
||||
|
||||
+2
-2
@@ -36,12 +36,12 @@ func _update_window_factor_disabled() -> void:
|
||||
window_factor_button.disabled = SettingsManager.fullscreen
|
||||
|
||||
|
||||
func _on_fullscreen_button_toggled(toggled: bool) -> void:
|
||||
func _on_fullscreen_check_button_toggled(toggled: bool) -> void:
|
||||
SettingsManager.fullscreen = toggled
|
||||
_update_window_factor_disabled()
|
||||
|
||||
|
||||
func _on_window_factor_button_item_selected(index: int) -> void:
|
||||
func _on_window_factor_option_button_item_selected(index: int) -> void:
|
||||
if not SettingsManager.fullscreen:
|
||||
SettingsManager.window_factor = index
|
||||
|
||||
|
||||
Reference in New Issue
Block a user