Added outro sequence
parent
2e1559d96e
commit
28c9b857bd
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=47 format=4 uid="uid://b88asko1ugyd2"]
|
[gd_scene load_steps=48 format=4 uid="uid://b88asko1ugyd2"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/global/GameManager.gd" id="1_eeg2d"]
|
[ext_resource type="Script" path="res://scripts/global/GameManager.gd" id="1_eeg2d"]
|
||||||
[ext_resource type="Script" path="res://scripts/tilemap/World.gd" id="1_k0rw8"]
|
[ext_resource type="Script" path="res://scripts/tilemap/World.gd" id="1_k0rw8"]
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
[ext_resource type="Script" path="res://scripts/tilemap/StepVisualization.gd" id="5_sr2su"]
|
[ext_resource type="Script" path="res://scripts/tilemap/StepVisualization.gd" id="5_sr2su"]
|
||||||
[ext_resource type="Script" path="res://scripts/player/tree/BehaviorTree.gd" id="6_efs30"]
|
[ext_resource type="Script" path="res://scripts/player/tree/BehaviorTree.gd" id="6_efs30"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cr4e1faypphkg" path="res://assets/images/ingame-instructions.png" id="6_q5cos"]
|
[ext_resource type="Texture2D" uid="uid://cr4e1faypphkg" path="res://assets/images/ingame-instructions.png" id="6_q5cos"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cynull1bsik42" path="res://assets/images/outro.png" id="6_uoa7b"]
|
||||||
[ext_resource type="Script" path="res://scripts/player/tree/impl/base/TaskSelector.gd" id="7_1jajd"]
|
[ext_resource type="Script" path="res://scripts/player/tree/impl/base/TaskSelector.gd" id="7_1jajd"]
|
||||||
[ext_resource type="Script" path="res://scripts/player/tree/impl/testing/WalkUpToMouse.gd" id="8_s6mqc"]
|
[ext_resource type="Script" path="res://scripts/player/tree/impl/testing/WalkUpToMouse.gd" id="8_s6mqc"]
|
||||||
[ext_resource type="Script" path="res://scripts/player/tree/impl/base/TaskSequence.gd" id="9_i67mw"]
|
[ext_resource type="Script" path="res://scripts/player/tree/impl/base/TaskSequence.gd" id="9_i67mw"]
|
||||||
|
|
@ -288,6 +289,21 @@ size_flags_horizontal = 4
|
||||||
size_flags_vertical = 8
|
size_flags_vertical = 8
|
||||||
texture = ExtResource("6_q5cos")
|
texture = ExtResource("6_q5cos")
|
||||||
|
|
||||||
|
[node name="OutroImageContainer" type="VBoxContainer" parent="Camera2D/CanvasLayer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="OutroImage" type="TextureRect" parent="Camera2D/CanvasLayer/OutroImageContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
texture = ExtResource("6_uoa7b")
|
||||||
|
expand_mode = 4
|
||||||
|
stretch_mode = 5
|
||||||
|
|
||||||
[node name="IntroImage" type="Sprite2D" parent="Camera2D"]
|
[node name="IntroImage" type="Sprite2D" parent="Camera2D"]
|
||||||
visible = false
|
visible = false
|
||||||
z_index = 1
|
z_index = 1
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,10 @@ func _process(delta: float) -> void:
|
||||||
game_ticker.start()
|
game_ticker.start()
|
||||||
else:
|
else:
|
||||||
game_ticker.stop()
|
game_ticker.stop()
|
||||||
|
if Input.is_action_just_pressed("key_1"):
|
||||||
|
get_tree().reload_current_scene()
|
||||||
|
if Input.is_action_just_pressed("key_2"):
|
||||||
|
handle_result_game_state( {"game_state_win": true} )
|
||||||
|
|
||||||
if intro_image.is_visible():
|
if intro_image.is_visible():
|
||||||
intro_image.set_scale(calculate_scale(intro_image.texture.get_size()))
|
intro_image.set_scale(calculate_scale(intro_image.texture.get_size()))
|
||||||
|
|
@ -73,7 +77,7 @@ func calculate_scale(image_size: Vector2) -> Vector2:
|
||||||
return Vector2(scale, scale)
|
return Vector2(scale, scale)
|
||||||
|
|
||||||
|
|
||||||
# SECTION: intro
|
# SECTION: intro / outro
|
||||||
|
|
||||||
func set_intro_opacity(opacity: float) -> void:
|
func set_intro_opacity(opacity: float) -> void:
|
||||||
intro_image.set_modulate(Color(1, 1, 1, opacity))
|
intro_image.set_modulate(Color(1, 1, 1, opacity))
|
||||||
|
|
@ -84,6 +88,11 @@ func set_instructions_opacity(opacity: float) -> void:
|
||||||
%InstructionsRect.show()
|
%InstructionsRect.show()
|
||||||
|
|
||||||
|
|
||||||
|
func set_outro_opacity(opacity: float) -> void:
|
||||||
|
%OutroImageContainer.set_modulate(Color(1, 1, 1, opacity))
|
||||||
|
%OutroImageContainer.show()
|
||||||
|
|
||||||
|
|
||||||
# SECTION: game tick
|
# SECTION: game tick
|
||||||
|
|
||||||
func player_health_depleted():
|
func player_health_depleted():
|
||||||
|
|
@ -151,6 +160,7 @@ func handle_result_game_state(blackboard: Dictionary) -> void:
|
||||||
if blackboard.has("game_state_win"):
|
if blackboard.has("game_state_win"):
|
||||||
EventsTracker.track(EventsTracker.Event.GAME_STATE_WIN)
|
EventsTracker.track(EventsTracker.Event.GAME_STATE_WIN)
|
||||||
game_ticker.stop()
|
game_ticker.stop()
|
||||||
|
get_tree().create_tween().tween_method(set_outro_opacity, 0.0, 1.0, 1.0)
|
||||||
|
|
||||||
|
|
||||||
func update_bars() -> void:
|
func update_bars() -> void:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue