Improved animation and bullet detection for heart shot ending.

This commit is contained in:
Henry 2026-03-06 14:17:51 +00:00
parent 5bf3078953
commit b12558a846
6 changed files with 14 additions and 3 deletions

View file

@ -149,11 +149,13 @@ func _on_ending(value: int):
heart_broken = true
horse_phase = false
horse_phase_check()
print("Some hearts are too wild.")
$Heart.hide()
$Heart.monitoring = false
$Heart.monitorable = false
print("Some hearts are too wild.")
EventBus.heart_beat.emit(0)
await get_tree().create_timer(2).timeout
EventBus.flash_screen.emit(.25)
$Heart.queue_free()
$Sprite2D.frame = 4
await get_tree().create_timer(4).timeout
EventBus.goose_talk.emit(4)

View file

@ -257,12 +257,14 @@ one_shot = true
[node name="Heart" type="Area2D" parent="." unique_id=1098254590 groups=["heart"]]
position = Vector2(0, -71)
rotation = -0.006150021
script = ExtResource("7_qsl3t")
[node name="Sprite2D" type="Sprite2D" parent="Heart" unique_id=520903474]
texture = ExtResource("7_2cdgk")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Heart" unique_id=11221326]
visible = false
position = Vector2(0.5, 0)
shape = SubResource("RectangleShape2D_qsl3t")

View file

@ -84,6 +84,7 @@ func _on_area_entered(area: Area2D) -> void:
if area.is_in_group("heart"):
print("Heart hit!")
EventBus.ending.emit(2)
queue_free()
#area.hit_detection()

View file

@ -4,4 +4,9 @@ func _ready() -> void:
EventBus.heart_beat.connect(_on_heart_beat)
func _on_heart_beat(tempo: float):
$AnimationPlayer.set_speed_scale(tempo)
if tempo == 0:
$AnimationPlayer.stop()
var tween = create_tween().set_trans(Tween.TRANS_LINEAR)
tween.tween_property(self, "modulate",Color(0,0,0), 2.5)
elif tempo > 0:
$AnimationPlayer.set_speed_scale(tempo)

View file

@ -136,6 +136,7 @@ func _on_area_entered(area):
if can_win == true:
print("You can win!")
EventBus.heart_beat.emit(2.5)
area.reparent(self)
EventBus.win_game.emit()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 319 B

Before After
Before After