diff --git a/src/screens/main_game/MainGame.gd b/src/screens/main_game/MainGame.gd index 319f3e0..deb3383 100644 --- a/src/screens/main_game/MainGame.gd +++ b/src/screens/main_game/MainGame.gd @@ -12,9 +12,13 @@ const LocationCardPoolScene := preload("res://objects/cards/date_cards/location_ const ActivityCardPoolScene := preload("res://objects/cards/date_cards/activity_cards/ActivityCardPool.tscn") const PlayerScene := preload("res://actors/player/Player.tscn") +# Remove profiles from the pool if the date score is above this value or below the negative value +const PROFILE_REMOVAL_THRESHOLD := 60 + # Node references onready var hud := $HUD as HUD onready var countdown_bar := hud.countdown_bar as CountdownBar +onready var fail_text_label := $HUD/FailTextLabel as RichTextLabel # Current phase var current_phase := 0 @@ -155,9 +159,13 @@ func finish_phase1() -> void: # Check if cards were chosen var pairing_screen := current_phase_scene as PairingScreen if not pairing_screen.all_card_slots_filled(): - print_debug("Player hasn't finished! :(") - # TODO: remove one life and restart phase - # TODO: disable movement while paused + print_debug("Player hasn't selected two profiles! :(") + + # Remove 100 points and show failure text, then restart round + total_score -= 100 + display_fail_text("Too slow!\n[color=#ff0000]-100 points[/color]\n(Please select two profile cards.)") + + # Dramatic pause! yield(get_tree().create_timer(1), "timeout") finish_round() return @@ -173,6 +181,13 @@ func finish_phase1() -> void: # Start next phase start_phase2() +func display_fail_text(_text: String) -> void: + fail_text_label.bbcode_text = "[center]%s[/center]" % _text + + # Remove text after 3 seconds + yield(get_tree().create_timer(3), "timeout") + fail_text_label.bbcode_text = "" + # Phase 2: Date planning func start_phase2() -> void: print_debug("Starting phase 2...") @@ -199,8 +214,7 @@ func start_phase2() -> void: countdown_bar.init_timer(10) # Start countdown (after a second delay) - # TODO: don't allow interactions in this delay - yield(get_tree().create_timer(1), "timeout") + yield(get_tree().create_timer(0.5), "timeout") countdown_bar.start_timer() func finish_phase2() -> void: @@ -255,7 +269,7 @@ func finish_phase3() -> void: total_score += _round_score # Remove cards from pool if the date was especially nice - or terrible. - if _round_score <= -100 or _round_score >= 100: + if _round_score <= -PROFILE_REMOVAL_THRESHOLD or _round_score >= PROFILE_REMOVAL_THRESHOLD: print_debug("Removing profiles %s and %s from pool." % [pairing_profile_card1.name, pairing_profile_card2.name]) profile_card_pool.remove_from_pool(pairing_profile_card1.name) profile_card_pool.remove_from_pool(pairing_profile_card2.name) diff --git a/src/screens/main_game/phase1/PairingScreen.gd b/src/screens/main_game/phase1/PairingScreen.gd index 42ccca8..a8b5d21 100644 --- a/src/screens/main_game/phase1/PairingScreen.gd +++ b/src/screens/main_game/phase1/PairingScreen.gd @@ -44,7 +44,6 @@ func all_card_slots_filled() -> bool: func find_card_touched_by_player() -> ProfileCard: for _card in profile_cards: var card := _card as ProfileCard - # TODO: Handle cases where multiple cards are touched at the same time if card and card.overlaps_body(player) and card.selectable: return card return null diff --git a/src/screens/main_game/phase2/PlanningScreen.gd b/src/screens/main_game/phase2/PlanningScreen.gd index ac8b480..5a641f8 100644 --- a/src/screens/main_game/phase2/PlanningScreen.gd +++ b/src/screens/main_game/phase2/PlanningScreen.gd @@ -68,7 +68,6 @@ func all_card_slots_filled() -> bool: func find_card_touched_by_player() -> BaseDateCard: for _card in date_cards: var card := _card as BaseDateCard - # TODO: Handle cases where multiple cards are touched at the same time if card and card.overlaps_body(player) and card.selectable: return card return null diff --git a/src/screens/main_game/phase3/DatingScreen.tscn b/src/screens/main_game/phase3/DatingScreen.tscn index e1221e2..5ffcab0 100644 --- a/src/screens/main_game/phase3/DatingScreen.tscn +++ b/src/screens/main_game/phase3/DatingScreen.tscn @@ -10,8 +10,6 @@ script = ExtResource( 1 ) [node name="DateOMeter" parent="." index="0" instance=ExtResource( 3 )] position = Vector2( 640, 80 ) -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." index="1"] - [node name="StatusTextLabel" type="RichTextLabel" parent="." index="1"] anchor_right = 1.0 anchor_bottom = 1.0 @@ -25,3 +23,5 @@ bbcode_text = "[center]Checking romantic compatibility... text = "Checking romantic compatibility... No points" fit_content_height = true + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." index="2"] diff --git a/src/ui/hud/HUD.tscn b/src/ui/hud/HUD.tscn index c8a758a..360d410 100644 --- a/src/ui/hud/HUD.tscn +++ b/src/ui/hud/HUD.tscn @@ -37,3 +37,13 @@ anchor_bottom = 1.0 margin_left = 1080.0 margin_top = 680.0 text = "Score: 1000" + +[node name="FailTextLabel" type="RichTextLabel" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 320.0 +margin_top = 616.0 +margin_right = -320.0 +margin_bottom = -8.0 +bbcode_enabled = true +fit_content_height = true