Added win condition for level 1 and added boss fight for level 5
This commit is contained in:
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,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