Fixed debugger errors in many files and optimized some scenes/code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
extends Label
|
||||
|
||||
signal timer_end
|
||||
signal timer_out
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
@@ -8,5 +8,5 @@ func _process(_delta: float) -> void:
|
||||
set_text('%02d:%02d' % [time_seconds, int(($Timer.get_time_left() - time_seconds) * 100)])
|
||||
|
||||
if $Timer.get_time_left() == 0:
|
||||
get_tree().change_scene('res://Levels/Hub World.tscn')
|
||||
emit_signal('timer_out')
|
||||
return
|
||||
|
88
GUI/HUD.gd
88
GUI/HUD.gd
@@ -5,76 +5,76 @@ var weapon = "sword"
|
||||
|
||||
|
||||
func _on_Add_Currency_pressed() -> void:
|
||||
emit_signal('add_currency', 1)
|
||||
return
|
||||
emit_signal('add_currency', 1)
|
||||
return
|
||||
|
||||
|
||||
func update_currency(amount: int) -> void:
|
||||
$Currency.set_text(String(amount))
|
||||
return
|
||||
$Currency.set_text(String(amount))
|
||||
return
|
||||
|
||||
|
||||
func update_health(value: int) -> void:
|
||||
$'Health Bar'.value = value
|
||||
return
|
||||
$'Health Bar'.value = value
|
||||
return
|
||||
|
||||
|
||||
func _on_weapon_slot_pressed() -> void:
|
||||
$'Weapon Selection'.set_visible(not $'Weapon Selection'.visible)
|
||||
return
|
||||
$'Weapon Selection'.set_visible(not $'Weapon Selection'.visible)
|
||||
return
|
||||
|
||||
|
||||
func _on_select_bow_pressed() -> void:
|
||||
$'Weapon Selection/Bow'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Bow/Weapon'.get_normal_texture())
|
||||
$'Weapon Selection/Bow'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Bow/Weapon'.get_normal_texture())
|
||||
|
||||
$'Weapon Selection/Javelin'.set_visible(true)
|
||||
$'Weapon Selection/Staff'.set_visible(true)
|
||||
$'Weapon Selection/Sword'.set_visible(true)
|
||||
$'Weapon Selection/Javelin'.set_visible(true)
|
||||
$'Weapon Selection/Staff'.set_visible(true)
|
||||
$'Weapon Selection/Sword'.set_visible(true)
|
||||
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "bow"
|
||||
return
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "bow"
|
||||
return
|
||||
|
||||
|
||||
func _on_select_javelin_pressed() -> void:
|
||||
$'Weapon Selection/Javelin'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Javelin/Weapon'.get_normal_texture())
|
||||
$'Weapon Selection/Javelin'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Javelin/Weapon'.get_normal_texture())
|
||||
|
||||
$'Weapon Selection/Bow'.set_visible(true)
|
||||
$'Weapon Selection/Staff'.set_visible(true)
|
||||
$'Weapon Selection/Sword'.set_visible(true)
|
||||
$'Weapon Selection/Bow'.set_visible(true)
|
||||
$'Weapon Selection/Staff'.set_visible(true)
|
||||
$'Weapon Selection/Sword'.set_visible(true)
|
||||
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "javelin"
|
||||
return
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "javelin"
|
||||
return
|
||||
|
||||
|
||||
func _on_select_staff_pressed() -> void:
|
||||
$'Weapon Selection/Staff'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Staff/Weapon'.get_normal_texture())
|
||||
$'Weapon Selection/Staff'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Staff/Weapon'.get_normal_texture())
|
||||
|
||||
$'Weapon Selection/Bow'.set_visible(true)
|
||||
$'Weapon Selection/Javelin'.set_visible(true)
|
||||
$'Weapon Selection/Sword'.set_visible(true)
|
||||
$'Weapon Selection/Bow'.set_visible(true)
|
||||
$'Weapon Selection/Javelin'.set_visible(true)
|
||||
$'Weapon Selection/Sword'.set_visible(true)
|
||||
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "staff"
|
||||
return
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "staff"
|
||||
return
|
||||
|
||||
|
||||
func _on_select_sword_pressed() -> void:
|
||||
$'Weapon Selection/Sword'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Sword/Weapon'.get_normal_texture())
|
||||
$'Weapon Selection/Sword'.set_visible(false)
|
||||
$'Equipped Weapon/Weapon'.set_normal_texture(
|
||||
$'Weapon Selection/Sword/Weapon'.get_normal_texture())
|
||||
|
||||
$'Weapon Selection/Bow'.set_visible(true)
|
||||
$'Weapon Selection/Javelin'.set_visible(true)
|
||||
$'Weapon Selection/Staff'.set_visible(true)
|
||||
$'Weapon Selection/Bow'.set_visible(true)
|
||||
$'Weapon Selection/Javelin'.set_visible(true)
|
||||
$'Weapon Selection/Staff'.set_visible(true)
|
||||
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "sword"
|
||||
return
|
||||
$'Weapon Selection'.set_visible(false)
|
||||
weapon = "sword"
|
||||
return
|
||||
|
@@ -4,7 +4,7 @@ export var hub_world_path: String = 'res://Levels/Hub World.tscn'
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
if get_tree().change_scene(hub_world_path) != OK:
|
||||
print('ERROR: Level Ending failed to change scene to Hub World.')
|
||||
queue_free()
|
||||
return
|
||||
if get_tree().change_scene(hub_world_path) != OK:
|
||||
print('ERROR: Level Ending failed to change scene to Hub World.')
|
||||
queue_free()
|
||||
return
|
||||
|
@@ -4,36 +4,36 @@ signal complete(option)
|
||||
|
||||
|
||||
func _on_new_game_button_pressed() -> void:
|
||||
emit_signal('complete', 'new game')
|
||||
return
|
||||
emit_signal('complete', 'new game')
|
||||
return
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
return
|
||||
get_tree().quit()
|
||||
return
|
||||
|
||||
|
||||
func _on_continue_button_mouse_entered() -> void:
|
||||
if not $'Menu/Menu Elements/Menu Options/Continue/Continue Button'.disabled:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
if not $'Menu/Menu Elements/Menu Options/Continue/Continue Button'.disabled:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _on_new_game_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _on_settings_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _on_credits_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _on_quit_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
@@ -4,26 +4,26 @@ signal complete
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Fade in
|
||||
if not $Tween.interpolate_property(self, 'self_modulate:a', 0, 1, 3, Tween.TRANS_LINEAR, Tween.EASE_IN):
|
||||
print('ERROR: Splash Screen fade in animation has errors.')
|
||||
if not $Tween.start():
|
||||
print('ERROR: Splash Screen fade in animation failed to start.')
|
||||
# Fade in
|
||||
if not $Tween.interpolate_property(self, 'self_modulate:a', 0, 1, 3, Tween.TRANS_LINEAR, Tween.EASE_IN):
|
||||
print('ERROR: Splash Screen fade in animation has errors.')
|
||||
if not $Tween.start():
|
||||
print('ERROR: Splash Screen fade in animation failed to start.')
|
||||
|
||||
yield($Tween, 'tween_completed') # Wait for fade in to complete
|
||||
yield($Tween, 'tween_completed') # Wait for fade in to complete
|
||||
|
||||
# Fade out
|
||||
if not $Tween.interpolate_property(self, 'self_modulate:a', 1, 0, 3, Tween.TRANS_LINEAR, Tween.EASE_OUT, 2):
|
||||
print('ERROR: Splash Screen fade out animation has errors.')
|
||||
if not $Tween.start():
|
||||
print('ERROR: Splash Screen fade out animation failed to start.')
|
||||
# Fade out
|
||||
if not $Tween.interpolate_property(self, 'self_modulate:a', 1, 0, 3, Tween.TRANS_LINEAR, Tween.EASE_OUT, 2):
|
||||
print('ERROR: Splash Screen fade out animation has errors.')
|
||||
if not $Tween.start():
|
||||
print('ERROR: Splash Screen fade out animation failed to start.')
|
||||
|
||||
yield($Tween, 'tween_completed') # Wait for fade out to complete
|
||||
emit_signal('complete')
|
||||
return
|
||||
yield($Tween, 'tween_completed') # Wait for fade out to complete
|
||||
emit_signal('complete')
|
||||
return
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed('ui_accept'):
|
||||
emit_signal('complete')
|
||||
return
|
||||
if event.is_action_pressed('ui_accept'):
|
||||
emit_signal('complete')
|
||||
return
|
||||
|
Reference in New Issue
Block a user