Initial jam build, 2 endings— secret ending glitches and doesn't show
title upon completion.
This commit is contained in:
parent
ab0a4e24f7
commit
7b47e847ae
14 changed files with 496 additions and 58 deletions
144
scenes/boss.gd
144
scenes/boss.gd
|
|
@ -6,24 +6,36 @@ var bullet_scene = preload("res://scenes/enemy_bullet.tscn")
|
|||
var start_pos = Vector2.ZERO
|
||||
var speed = 0
|
||||
var tween_speed: float = 1.4
|
||||
var pause: bool = false
|
||||
|
||||
var horse_counter = 1
|
||||
|
||||
var exploding = false
|
||||
var horse_counter: int = 0
|
||||
var horse_phase: bool = true
|
||||
var exploding:bool = false
|
||||
var heart_taken: bool = false
|
||||
var heart_broken: bool = false
|
||||
|
||||
@onready var boss = $AnimationPlayer
|
||||
@onready var screensize = get_viewport_rect().size
|
||||
|
||||
func _ready():
|
||||
EventBus.ending.connect(_on_ending)
|
||||
boss_intro()
|
||||
$Heart.monitoring = false
|
||||
$Heart.monitorable = false
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if pause == true: return
|
||||
|
||||
|
||||
func boss_intro():
|
||||
# Move boss into screen
|
||||
position = Vector2(screensize.x / 2, -screensize.y)
|
||||
var tween = create_tween().set_ease(Tween.EASE_OUT)
|
||||
tween.tween_property(self, "position:y", 100, 2)
|
||||
await tween.finished
|
||||
boss_intro()
|
||||
|
||||
|
||||
|
||||
func boss_intro():
|
||||
# Introduce Lady of Whispers
|
||||
print("Boss intro!")
|
||||
await get_tree().create_timer(2).timeout
|
||||
boss.play("align")
|
||||
|
|
@ -32,57 +44,119 @@ func boss_intro():
|
|||
await get_tree().create_timer(4).timeout
|
||||
boss.play("whisper")
|
||||
await get_tree().create_timer(1).timeout
|
||||
boss_horse()
|
||||
|
||||
# Check to see if horse phase is available
|
||||
horse_phase_check()
|
||||
|
||||
|
||||
func horse_phase_check():
|
||||
if horse_phase == true: boss_horse()
|
||||
if horse_phase == false:
|
||||
print("No more horse!")
|
||||
$Sprite2D.frame = 0
|
||||
if horse_phase == false and heart_broken == true:
|
||||
$Sprite2D.frame = 4
|
||||
|
||||
func boss_horse():
|
||||
$Horse.horse_phase = true
|
||||
print("Boss horse!")
|
||||
await get_tree().create_timer(2).timeout
|
||||
EventBus.flash_screen.emit(.25)
|
||||
$Heart.hide()
|
||||
$Horse.show()
|
||||
$Sprite2D.frame = 7
|
||||
$Horse.start()
|
||||
var horse_player = $Horse/AnimationPlayer
|
||||
horse_player.play("run")
|
||||
await get_tree().create_timer(10).timeout
|
||||
EventBus.flash_screen.emit(.25)
|
||||
$Horse.hide()
|
||||
$Horse.end()
|
||||
await get_tree().create_timer(5).timeout
|
||||
horse_counter += 1
|
||||
lady_of_whispers()
|
||||
|
||||
if heart_taken == false:
|
||||
print("Boss horse!")
|
||||
await get_tree().create_timer(2).timeout
|
||||
EventBus.flash_screen.emit(.25)
|
||||
$Heart.hide()
|
||||
$Heart.monitoring = false
|
||||
$Sprite2D.frame = 7
|
||||
$Horse.show()
|
||||
$Horse.start()
|
||||
var horse_player = $Horse/AnimationPlayer
|
||||
horse_player.play("run")
|
||||
await get_tree().create_timer(10).timeout
|
||||
EventBus.flash_screen.emit(.25)
|
||||
$Horse.hide()
|
||||
$Horse.end()
|
||||
await get_tree().create_timer(5).timeout
|
||||
horse_counter += 1
|
||||
lady_of_whispers()
|
||||
|
||||
if heart_taken == true or heart_broken == true:
|
||||
horse_phase = false
|
||||
horse_phase_check()
|
||||
|
||||
|
||||
func lady_of_whispers():
|
||||
|
||||
if horse_counter == 2:
|
||||
|
||||
print("Lady of Whispers offers you a heart!")
|
||||
boss.play("rise")
|
||||
await get_tree().create_timer(4).timeout
|
||||
# boss.play("whisper")
|
||||
offer_heart()
|
||||
|
||||
|
||||
if horse_counter <= 1:
|
||||
print("Lady of Whispers!")
|
||||
boss.play("rise")
|
||||
await get_tree().create_timer(4).timeout
|
||||
boss.play("whisper")
|
||||
await boss.animation_finished
|
||||
await get_tree().create_timer(1).timeout
|
||||
boss_horse()
|
||||
horse_phase_check()
|
||||
|
||||
func hit_detection():
|
||||
return
|
||||
|
||||
func offer_heart():
|
||||
$Heart.show()
|
||||
print("Lady of Whispers offers you a heart!")
|
||||
boss.play("rise")
|
||||
await get_tree().create_timer(4).timeout
|
||||
boss_horse()
|
||||
horse_counter = 0
|
||||
print("Horse Counter:",horse_counter)
|
||||
|
||||
$Heart.show()
|
||||
$Heart.monitoring = true
|
||||
$Heart.monitorable = true
|
||||
heart_check()
|
||||
|
||||
func heart_check():
|
||||
print("Heart check!")
|
||||
if heart_taken == false:
|
||||
await get_tree().create_timer(4).timeout
|
||||
horse_counter = 0
|
||||
print("Horse Counter:",horse_counter)
|
||||
|
||||
if heart_taken == true or heart_broken == true:
|
||||
$Heart.monitoring = false
|
||||
$Heart.monitorable = false
|
||||
horse_phase = false
|
||||
|
||||
horse_phase_check()
|
||||
|
||||
|
||||
|
||||
func _on_ending(value: int):
|
||||
if value == 1:
|
||||
heart_taken = true
|
||||
horse_phase = false
|
||||
#horse_phase_check()
|
||||
print("Fix your broken heart or die")
|
||||
$Sprite2D.frame = 0
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "position:y", 180, 2).set_ease(Tween.EASE_OUT)
|
||||
tween.tween_property(self, "position:y", 60 * -1, .25).set_ease(Tween.EASE_IN)
|
||||
await get_tree().create_timer(8).timeout
|
||||
EventBus.goose_talk.emit(3)
|
||||
self.monitoring = false
|
||||
self.monitorable = false
|
||||
|
||||
|
||||
if value == 2:
|
||||
heart_broken = true
|
||||
horse_phase = false
|
||||
horse_phase_check()
|
||||
print("Some hearts are too wild.")
|
||||
$Heart.hide()
|
||||
$Heart.monitoring = false
|
||||
$Heart.monitorable = false
|
||||
EventBus.flash_screen.emit(.25)
|
||||
$Sprite2D.frame = 4
|
||||
await get_tree().create_timer(4).timeout
|
||||
EventBus.goose_talk.emit(4)
|
||||
self.monitoring = false
|
||||
self.monitorable = false
|
||||
EventBus.win_game.emit()
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue