diff options
author | Henrique Alves <henriquelalves@gmail.com> | 2022-07-17 02:24:09 -0300 |
---|---|---|
committer | Henrique Alves <henriquelalves@gmail.com> | 2022-07-17 02:24:09 -0300 |
commit | a965d83578a726624c8b4455867b307174a82047 (patch) | |
tree | 71f88ad9ddbb95035cefa18ec55aaeb98e0c616c /Scenes | |
parent | f0f967030b085d0841f7f0b46818fe33c77b7154 (diff) | |
download | gamejam-gmtk-2022-a965d83578a726624c8b4455867b307174a82047.tar.gz gamejam-gmtk-2022-a965d83578a726624c8b4455867b307174a82047.tar.bz2 gamejam-gmtk-2022-a965d83578a726624c8b4455867b307174a82047.zip |
Transition scene
Diffstat (limited to 'Scenes')
-rw-r--r-- | Scenes/Dungeon.gd | 2 | ||||
-rw-r--r-- | Scenes/Transition.gd | 47 | ||||
-rw-r--r-- | Scenes/Transition.tscn | 332 |
3 files changed, 380 insertions, 1 deletions
diff --git a/Scenes/Dungeon.gd b/Scenes/Dungeon.gd index 9f8bce8..ae758ce 100644 --- a/Scenes/Dungeon.gd +++ b/Scenes/Dungeon.gd @@ -95,7 +95,7 @@ func _process(delta): func next_stage(): Global.turns += Global.BONUS_TURNS_STAGE_FINISH Global.current_stage += 1 - get_tree().change_scene("res://Scenes/Dungeon.tscn") + get_tree().change_scene("res://Scenes/Transition.tscn") func process_turn_logic(): # player attack diff --git a/Scenes/Transition.gd b/Scenes/Transition.gd new file mode 100644 index 0000000..02dee1d --- /dev/null +++ b/Scenes/Transition.gd @@ -0,0 +1,47 @@ +extends Spatial + +export (Array, NodePath) var dices +onready var camera = get_viewport().get_camera() + +onready var prev_stage = 0 +onready var next_stage = 0 + +func _ready(): + prev_stage = Global.current_stage - 1 + next_stage = Global.current_stage + + get_node(dices[prev_stage+1]).show() + + yield(animate_next_stage(), "completed") + yield(get_tree().create_timer(2), "timeout") + get_tree().change_scene("res://Scenes/Dungeon.tscn") + +func animate_next_stage(): + var pos0 = $UIController/ArmPivot.rect_position + var pos1 = camera.unproject_position(get_node(dices[prev_stage+1]).translation) + var pos2 = camera.unproject_position(get_node(dices[next_stage+1]).translation) + + yield(get_tree().create_timer(1), "timeout") + tween_pos(pos1) + yield(get_tree().create_timer(1), "timeout") + get_node(dices[prev_stage+1]).hide() + tween_pos(pos2) + yield(get_tree().create_timer(1), "timeout") + get_node(dices[next_stage+1]).show() + tween_pos(pos0) + +func tween_pos(pos): + $Tween.interpolate_property(\ + $UIController/ArmPivot,\ + "rect_position",\ + $UIController/ArmPivot.rect_position,\ + pos,\ + 1,\ + Tween.TRANS_CUBIC,\ + Tween.EASE_OUT + ) + $Tween.start() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/Scenes/Transition.tscn b/Scenes/Transition.tscn new file mode 100644 index 0000000..e749137 --- /dev/null +++ b/Scenes/Transition.tscn @@ -0,0 +1,332 @@ +[gd_scene load_steps=19 format=2] + +[ext_resource path="res://Assets/transition.png" type="Texture" id=1] +[ext_resource path="res://Scenes/CameraControl.gd" type="Script" id=2] +[ext_resource path="res://Scenes/Transition.gd" type="Script" id=3] +[ext_resource path="res://Assets/arm.png" type="Texture" id=7] +[ext_resource path="res://Assets/3_dots.png" type="Texture" id=8] +[ext_resource path="res://Assets/DiceFaceMaterial.tres" type="Material" id=9] +[ext_resource path="res://Assets/6_dots.png" type="Texture" id=10] +[ext_resource path="res://Assets/5_dots.png" type="Texture" id=11] +[ext_resource path="res://Assets/2_dots.png" type="Texture" id=12] +[ext_resource path="res://Assets/4_dots.png" type="Texture" id=13] + +[sub_resource type="QuadMesh" id=5] + +[sub_resource type="SpatialMaterial" id=6] +albedo_texture = ExtResource( 10 ) + +[sub_resource type="SpatialMaterial" id=7] +albedo_texture = ExtResource( 12 ) + +[sub_resource type="SpatialMaterial" id=8] +albedo_texture = ExtResource( 11 ) + +[sub_resource type="SpatialMaterial" id=9] +albedo_texture = ExtResource( 8 ) + +[sub_resource type="SpatialMaterial" id=10] +albedo_texture = ExtResource( 13 ) + +[sub_resource type="ProceduralSky" id=2] + +[sub_resource type="Environment" id=3] +background_mode = 2 +background_sky = SubResource( 2 ) +ambient_light_color = Color( 1, 1, 1, 1 ) +dof_blur_far_amount = 0.06 + +[node name="Transition" type="Spatial"] +script = ExtResource( 3 ) +dices = [ NodePath("Mesh0"), NodePath("Mesh"), NodePath("Mesh2"), NodePath("Mesh3"), NodePath("Mesh4"), NodePath("Mesh5"), NodePath("Mesh6") ] + +[node name="Mesh0" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -10.3316, 0.5, 1.03296 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh0"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh0"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh0"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh0"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh0"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh0"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Mesh" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -7.67083, 0.5, 1.03296 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Mesh2" type="Spatial" parent="."] +transform = Transform( 0.0210471, -0.999779, 0, 0.999779, 0.0210471, 0, 0, 0, 1, -5.33128, 0.5, 1.10751 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh2"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh2"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh2"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh2"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh2"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh2"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Mesh3" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, -0.024624, 0.999697, 0, -0.999697, -0.024624, -2.97975, 0.5, 1.17976 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh3"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh3"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh3"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh3"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh3"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh3"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Mesh4" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 0.0281309, -0.999604, 0, 0.999604, 0.0281309, -0.251982, 0.5, 1.13707 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh4"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh4"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh4"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh4"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh4"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh4"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Mesh5" type="Spatial" parent="."] +transform = Transform( 0.0418233, 0.999125, 0, -0.999125, 0.0418233, 0, 0, 0, 1, 2.17785, 0.5, 1.16827 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh5"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh5"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh5"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh5"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh5"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh5"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Mesh6" type="Spatial" parent="."] +transform = Transform( -0.0328586, 0.0143383, 0.999357, 0, -0.999897, 0.014346, 0.99946, 0.00047139, 0.0328552, 4.59073, 0.5, 1.19982 ) +visible = false + +[node name="FaceUp" type="MeshInstance" parent="Mesh6"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.5, 0 ) +material_override = ExtResource( 9 ) +mesh = SubResource( 5 ) +material/0 = null + +[node name="FaceDown" type="MeshInstance" parent="Mesh6"] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -0.5, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 6 ) + +[node name="FaceRight" type="MeshInstance" parent="Mesh6"] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 7 ) + +[node name="FaceLeft" type="MeshInstance" parent="Mesh6"] +transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.5, 0, 0 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 8 ) + +[node name="FaceForward" type="MeshInstance" parent="Mesh6"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 9 ) + +[node name="FaceBackward" type="MeshInstance" parent="Mesh6"] +transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, -0.5 ) +mesh = SubResource( 5 ) +material/0 = SubResource( 10 ) + +[node name="Background" type="Sprite3D" parent="."] +transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0 ) +pixel_size = 0.03 +texture = ExtResource( 1 ) + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource( 3 ) + +[node name="Pitch" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) +script = ExtResource( 2 ) + +[node name="Yaw" type="Spatial" parent="Pitch"] +transform = Transform( 1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 0, 0 ) + +[node name="Camera" type="Camera" parent="Pitch/Yaw"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30 ) +projection = 1 +current = true +fov = 24.0 +size = 10.0 + +[node name="DirectionalLight" type="DirectionalLight" parent="."] +transform = Transform( 0.73644, 0.441272, -0.512773, 0, 0.757975, 0.652284, 0.676503, -0.480367, 0.558203, 0, 35.1428, 0 ) +light_energy = 0.5 + +[node name="UIController" type="CanvasLayer" parent="."] + +[node name="ArmPivot" type="Control" parent="UIController"] +margin_left = -13.0 +margin_top = -239.0 +margin_right = 27.0 +margin_bottom = -199.0 + +[node name="Arm" type="TextureRect" parent="UIController/ArmPivot"] +margin_left = 201.0 +margin_top = 186.0 +margin_right = 828.0 +margin_bottom = 813.0 +rect_rotation = 78.9987 +rect_scale = Vector2( -1, 1 ) +texture = ExtResource( 7 ) +expand = true + +[node name="Tween" type="Tween" parent="."] |