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()
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ wait_time = 0.05
|
|||
one_shot = true
|
||||
|
||||
[node name="Heart" type="Area2D" parent="." unique_id=1098254590 groups=["heart"]]
|
||||
visible = false
|
||||
position = Vector2(0, -71)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Heart" unique_id=520903474]
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ func _process(delta):
|
|||
rotater.rotation_degrees -= 2.5 # Adjust rotation speed
|
||||
|
||||
func spawn_bullet():
|
||||
print("I'm spawning bullets!")
|
||||
var bullet = bullet_scene.instantiate()
|
||||
get_tree().root.add_child(bullet)
|
||||
bullet.position = rotater.global_position
|
||||
|
|
@ -73,7 +72,6 @@ func spawn_bullet():
|
|||
|
||||
|
||||
func _on_shoot_timer_timeout() -> void:
|
||||
print("Shoot timer timeout!")
|
||||
spawn_bullet()
|
||||
#for s in rotater.get_children():
|
||||
#var b = bullet_scene.instantiate()
|
||||
|
|
|
|||
|
|
@ -81,9 +81,9 @@ func _on_area_entered(area: Area2D) -> void:
|
|||
|
||||
|
||||
if area.is_in_group("heart"):
|
||||
print("I've shot the heart!")
|
||||
area.hit_detection()
|
||||
queue_free()
|
||||
print("Heart hit!")
|
||||
EventBus.ending.emit(2)
|
||||
#area.hit_detection()
|
||||
|
||||
|
||||
#func bullet_fx():
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ libraries/ = SubResource("AnimationLibrary_7ellt")
|
|||
|
||||
[node name="ImpactCRT" type="AudioStreamPlayer2D" parent="." unique_id=518408763]
|
||||
stream = ExtResource("6_gas3w")
|
||||
volume_db = -16.028
|
||||
|
||||
[connection signal="timeout" from="MoveTimer" to="." method="_on_timer_timeout"]
|
||||
[connection signal="timeout" from="ShootTimer" to="." method="_on_shoot_timer_timeout"]
|
||||
|
|
|
|||
|
|
@ -15,4 +15,9 @@ signal goose_talk(frame_index: int)
|
|||
signal flash_screen(duration: float)
|
||||
signal cloud_speed()
|
||||
|
||||
# Ending
|
||||
signal ending(value: int)
|
||||
signal win_game()
|
||||
signal secret_win_game()
|
||||
|
||||
@warning_ignore_restore("unused_signal") # put any future signals you add between the two ignore annotations
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ texture = ExtResource("1_wo8sg")
|
|||
[node name="Bubble" type="Sprite2D" parent="DapperGoose" unique_id=2012258473]
|
||||
position = Vector2(-108, -21)
|
||||
texture = ExtResource("3_g7ad0")
|
||||
hframes = 4
|
||||
hframes = 8
|
||||
|
||||
[node name="Quacking" type="Timer" parent="DapperGoose" unique_id=1836315393]
|
||||
wait_time = 3.0
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ func _ready():
|
|||
#EventBus.enemy_died.connect(_on_enemy_died)
|
||||
EventBus.enemy_hit.connect(_on_enemy_hit)
|
||||
EventBus.flash_screen.connect(_on_flash_screen)
|
||||
EventBus.win_game.connect(_on_win_game)
|
||||
EventBus.secret_win_game.connect(_on_secret_win_game)
|
||||
|
||||
|
||||
#func spawn_enemies():
|
||||
|
|
@ -78,7 +80,7 @@ func _on_player_died():
|
|||
# get_tree().call_group("enemies", "queue_free")
|
||||
# $Player.set_process(false)
|
||||
# get_tree().call_group("enemies", "set_process", false)
|
||||
EventBus.goose_talk.emit(3)
|
||||
EventBus.goose_talk.emit(7)
|
||||
instance.queue_free()
|
||||
game_over.show()
|
||||
$LevelAudio.stop()
|
||||
|
|
@ -91,6 +93,7 @@ func _on_player_died():
|
|||
func new_game():
|
||||
$CanvasLayer/Title.hide()
|
||||
# Ensure enemies are cleared.
|
||||
get_tree().call_group("boss", "queue_free")
|
||||
get_tree().call_group("enemies", "queue_free")
|
||||
get_tree().call_group("shards", "queue_free")
|
||||
get_tree().call_group("enemy_bullets", "queue_free")
|
||||
|
|
@ -115,7 +118,7 @@ func new_game():
|
|||
|
||||
# Do some DapperGoose talk
|
||||
await get_tree().create_timer(1.5).timeout
|
||||
EventBus.goose_talk.emit(2)
|
||||
EventBus.goose_talk.emit(6)
|
||||
|
||||
# Tell the enemies to spawn!
|
||||
#await get_tree().create_timer(.5).timeout
|
||||
|
|
@ -143,11 +146,21 @@ func _on_start_pressed():
|
|||
$Welcome.play()
|
||||
new_game()
|
||||
|
||||
func win_game():
|
||||
|
||||
func _on_secret_win_game():
|
||||
playing = false
|
||||
game_over.show()
|
||||
#await get_tree().create_timer(8).timeout
|
||||
game_over.hide()
|
||||
$CanvasLayer/Title.show()
|
||||
start_button.show()
|
||||
|
||||
|
||||
func _on_win_game():
|
||||
playing = false
|
||||
game_over.show()
|
||||
$Player._on_player_victory()
|
||||
await get_tree().create_timer(2).timeout
|
||||
await get_tree().create_timer(8).timeout
|
||||
game_over.hide()
|
||||
$CanvasLayer/Title.show()
|
||||
start_button.show()
|
||||
|
|
|
|||
|
|
@ -139,7 +139,8 @@ volume_db = -0.5
|
|||
|
||||
[node name="LevelAudio" type="AudioStreamPlayer2D" parent="." unique_id=2125260365]
|
||||
stream = ExtResource("12_trceg")
|
||||
volume_db = -13.178
|
||||
volume_db = -20.0
|
||||
pitch_scale = 0.8
|
||||
|
||||
[node name="Wave" parent="." unique_id=2117861058 instance=ExtResource("11_ya4ey")]
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ signal damage_taken
|
|||
var shield: int = 0:
|
||||
set = _on_set_shield
|
||||
|
||||
|
||||
var pause: bool = false
|
||||
var can_shoot = false
|
||||
var shader_active: bool = false:
|
||||
set(value):
|
||||
|
|
@ -32,6 +32,7 @@ func _ready():
|
|||
set_process(false)
|
||||
print(shield)
|
||||
EventBus.set_shield.connect(_on_set_shield)
|
||||
#EventBus.player_victory.connect(_on_player_victory)
|
||||
# start()
|
||||
|
||||
func start():
|
||||
|
|
@ -55,6 +56,8 @@ func start():
|
|||
# EventBus.shield_changed.emit(max_shield, old_value, shield)
|
||||
|
||||
func _process(delta):
|
||||
if pause == true: return
|
||||
|
||||
var input = Input.get_vector("left", "right", "up", "down")
|
||||
if input.x > 0:
|
||||
$Ship.frame = 2
|
||||
|
|
@ -129,9 +132,16 @@ func _on_area_entered(area):
|
|||
|
||||
if area.is_in_group("boss"):
|
||||
print("Entered boss!")
|
||||
shield -= int(max_shield / 2)
|
||||
_on_damage_taken()
|
||||
|
||||
if area.is_in_group("heart"):
|
||||
print("Got the heart!")
|
||||
pause = true
|
||||
reparent(area)
|
||||
ship.frame = 0
|
||||
EventBus.ending.emit(1)
|
||||
|
||||
|
||||
func _on_damage_taken():
|
||||
|
||||
|
|
@ -150,8 +160,10 @@ func _on_player_victory() -> void:
|
|||
print("Victory!")
|
||||
# get_node("EnemyBullet").monitoring = false #TODO make sure bullets stop monitoring!
|
||||
set_process(false)
|
||||
$Ship.frame = 1
|
||||
await get_tree().create_timer(1).timeout
|
||||
#$Ship.frame = 1
|
||||
self.monitorable = false
|
||||
self.monitoring = false
|
||||
await get_tree().create_timer(4).timeout
|
||||
# $Ship/Boosters/BoosterBurst.show()
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "position:y", 60 * -1, .25).set_ease(tween.EASE_IN)
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ region_rect = Rect2(0, 0, 96, 16)
|
|||
|
||||
[node name="HeadInflate" type="AudioStreamPlayer2D" parent="." unique_id=374500278]
|
||||
stream = ExtResource("10_y4r1p")
|
||||
volume_db = -9.973
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="damage_taken" from="." to="." method="_on_damage_taken"]
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ func _ready():
|
|||
|
||||
func spawn_enemies():
|
||||
|
||||
if wave_count == 1: #This is for CHICKENS
|
||||
if wave_count == 3: #This is for CHICKENS
|
||||
print("Enemy Wave: ", wave_count)
|
||||
enemy = CHICKEN
|
||||
for x in range(COLS):
|
||||
|
|
@ -38,7 +38,7 @@ func spawn_enemies():
|
|||
await get_tree().process_frame
|
||||
print_debug("Remaining enemies: ", enemy_count, ", ", get_tree().get_nodes_in_group("enemies").size())
|
||||
|
||||
if wave_count == 3: #This is for CRTs
|
||||
if wave_count == 1: #This is for CRTs
|
||||
print("Enemy Wave: ", wave_count)
|
||||
enemy = CRT
|
||||
var cols_mod = COLS - 1
|
||||
|
|
@ -53,7 +53,7 @@ func spawn_enemies():
|
|||
enemy_count = rows_mod * cols_mod
|
||||
await get_tree().process_frame
|
||||
|
||||
if wave_count == 0 : #This if for Mirror
|
||||
if wave_count == 2 : #This if for Mirror
|
||||
print("Enemy Wave: ", wave_count)
|
||||
|
||||
# Spawn Table
|
||||
|
|
@ -89,7 +89,7 @@ func spawn_enemies():
|
|||
s.start_all_animations()
|
||||
|
||||
|
||||
if wave_count == 2 : #This is for Boss
|
||||
if wave_count == 0 : #This is for Boss
|
||||
|
||||
# Hide the player
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ func wave_status():
|
|||
wave_complete = false
|
||||
|
||||
else:
|
||||
EventBus.goose_talk.emit(1)
|
||||
EventBus.goose_talk.emit(wave_count)
|
||||
wave_initialize()
|
||||
wave_complete = true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue