Improved animation and bullet detection for heart shot ending.
This commit is contained in:
parent
5bf3078953
commit
b12558a846
6 changed files with 14 additions and 3 deletions
|
|
@ -149,11 +149,13 @@ func _on_ending(value: int):
|
||||||
heart_broken = true
|
heart_broken = true
|
||||||
horse_phase = false
|
horse_phase = false
|
||||||
horse_phase_check()
|
horse_phase_check()
|
||||||
print("Some hearts are too wild.")
|
|
||||||
$Heart.hide()
|
|
||||||
$Heart.monitoring = false
|
$Heart.monitoring = false
|
||||||
$Heart.monitorable = 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)
|
EventBus.flash_screen.emit(.25)
|
||||||
|
$Heart.queue_free()
|
||||||
$Sprite2D.frame = 4
|
$Sprite2D.frame = 4
|
||||||
await get_tree().create_timer(4).timeout
|
await get_tree().create_timer(4).timeout
|
||||||
EventBus.goose_talk.emit(4)
|
EventBus.goose_talk.emit(4)
|
||||||
|
|
|
||||||
|
|
@ -257,12 +257,14 @@ one_shot = true
|
||||||
|
|
||||||
[node name="Heart" type="Area2D" parent="." unique_id=1098254590 groups=["heart"]]
|
[node name="Heart" type="Area2D" parent="." unique_id=1098254590 groups=["heart"]]
|
||||||
position = Vector2(0, -71)
|
position = Vector2(0, -71)
|
||||||
|
rotation = -0.006150021
|
||||||
script = ExtResource("7_qsl3t")
|
script = ExtResource("7_qsl3t")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Heart" unique_id=520903474]
|
[node name="Sprite2D" type="Sprite2D" parent="Heart" unique_id=520903474]
|
||||||
texture = ExtResource("7_2cdgk")
|
texture = ExtResource("7_2cdgk")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Heart" unique_id=11221326]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Heart" unique_id=11221326]
|
||||||
|
visible = false
|
||||||
position = Vector2(0.5, 0)
|
position = Vector2(0.5, 0)
|
||||||
shape = SubResource("RectangleShape2D_qsl3t")
|
shape = SubResource("RectangleShape2D_qsl3t")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@ func _on_area_entered(area: Area2D) -> void:
|
||||||
if area.is_in_group("heart"):
|
if area.is_in_group("heart"):
|
||||||
print("Heart hit!")
|
print("Heart hit!")
|
||||||
EventBus.ending.emit(2)
|
EventBus.ending.emit(2)
|
||||||
|
queue_free()
|
||||||
#area.hit_detection()
|
#area.hit_detection()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,9 @@ func _ready() -> void:
|
||||||
EventBus.heart_beat.connect(_on_heart_beat)
|
EventBus.heart_beat.connect(_on_heart_beat)
|
||||||
|
|
||||||
func _on_heart_beat(tempo: float):
|
func _on_heart_beat(tempo: float):
|
||||||
|
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)
|
$AnimationPlayer.set_speed_scale(tempo)
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ func _on_area_entered(area):
|
||||||
|
|
||||||
if can_win == true:
|
if can_win == true:
|
||||||
print("You can win!")
|
print("You can win!")
|
||||||
|
EventBus.heart_beat.emit(2.5)
|
||||||
area.reparent(self)
|
area.reparent(self)
|
||||||
EventBus.win_game.emit()
|
EventBus.win_game.emit()
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 319 B |
Loading…
Add table
Add a link
Reference in a new issue