-[gd_scene load_steps=4 format=3 uid="uid://b55f770t7xs6a"]
+[gd_scene load_steps=7 format=3 uid="uid://b55f770t7xs6a"]
[ext_resource type="Texture2D" uid="uid://npjqgc3tdgs1" path="res://gimp/DungeonEntrance.png" id="1_vo6aq"]
[ext_resource type="Texture2D" uid="uid://nocjsuuft8qx" path="res://gimp/DungeonGuard.png" id="2_nujkm"]
radius = 15.0
height = 32.0
+[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ocep5"]
+normal = Vector2(1, 0)
+
+[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_gq7j0"]
+
+[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_xvl4y"]
+normal = Vector2(-1, 0)
+
[node name="Node2D" type="Node2D"]
[node name="DungeonEntrance" type="Sprite2D" parent="."]
texture_filter = 1
-position = Vector2(-1, -320)
+position = Vector2(2, -784)
+scale = Vector2(1.995, 1.995)
texture = ExtResource("1_vo6aq")
[node name="StaticBody2D" type="StaticBody2D" parent="DungeonEntrance"]
+visible = false
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DungeonEntrance/StaticBody2D"]
+visible = false
polygon = PackedVector2Array(-160, 127, -159, -129, 160, -126, 161, 127, 21, 127, 21, 79, -19, 79, -19, 127)
[node name="DungeonGuard" type="Sprite2D" parent="."]
texture_filter = 1
-position = Vector2(0, -208)
+position = Vector2(2, -552)
+scale = Vector2(1.71, 1.71)
texture = ExtResource("2_nujkm")
-[node name="StaticBody2D" type="StaticBody2D" parent="DungeonGuard"]
+[node name="DungeonGuardStaticBody" type="StaticBody2D" parent="DungeonGuard"]
+visible = false
-[node name="CollisionShape2D" type="CollisionShape2D" parent="DungeonGuard/StaticBody2D"]
+[node name="DungeonGuardCollider" type="CollisionShape2D" parent="DungeonGuard/DungeonGuardStaticBody"]
+visible = false
shape = SubResource("CapsuleShape2D_18p8i")
+
+[node name="StaticBody2D" type="StaticBody2D" parent="."]
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
+position = Vector2(-307, -1)
+shape = SubResource("WorldBoundaryShape2D_ocep5")
+
+[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"]
+position = Vector2(0, 210)
+shape = SubResource("WorldBoundaryShape2D_gq7j0")
+
+[node name="CollisionShape2D3" type="CollisionShape2D" parent="StaticBody2D"]
+position = Vector2(314, 5)
+shape = SubResource("WorldBoundaryShape2D_xvl4y")
+
+[node name="Label" type="Label" parent="."]
+z_index = 5
+offset_left = -111.0
+offset_top = 152.0
+offset_right = 111.0
+offset_bottom = 175.0
+text = "The Dungeon is to the north!"
@onready var music_player = $MusicPlayer
+@onready var camera = $Camera2D
+
+const camera_move_speed = 80.0
+
const text_speed = 0.08
const start_text = "You seek the elementals?\nProve your worth!\nShow the elements your mastery over summoning, and they are yours!"
Introduction_05_post,
Introduction_06,
Introduction_06_post,
- Dungeon_Entrance
+ Dungeon_Entrance_pre,
+ Dungeon_Entrance_loading,
+ Dungeon_Entrance,
+ Dungeon_Entrance_Battle,
}
static var state_dict = {}
var tween_volume
+var tween_text
var diamonds_gone = false
var gander
+var level
+var level_guard = null
+
# Called when the node enters the scene tree for the first time.
func _ready():
if not state_dict.has("state"):
update_text(intro_text_06, StateT.Introduction_06_post)
StateT.Introduction_06_post:
pass
+ StateT.Dungeon_Entrance_loading:
+ gander.player_controlled = true
+ gander.current_scene_type = gander.GanderSceneT.Gameplay
+ var dungeon_scene = load("res://DungeonEntrance.tscn")
+ level = dungeon_scene.instantiate()
+ add_child(level)
+ state_dict["state"] = StateT.Dungeon_Entrance
+ lower_label.text = "Arrow keys/WASD/Left-Stick to move."
+ tween_text = get_tree().create_tween()
+ tween_text.tween_property(lower_label, "self_modulate", Color(1, 1, 1, 0), 5)
+ StateT.Dungeon_Entrance:
+ camera_to_gander(delta)
+ if level_guard == null:
+ level_guard = level.find_child("DungeonGuardStaticBody")
+ if level_guard != null and gander.last_collided_id == level_guard.get_instance_id():
+ print("collided with guard.")
+ gander.last_collided_id = null
_:
pass
if gander is MainCharacter and not gander.player_controlled and gander.current_scene_type == gander.GanderSceneT.Introduction:
state_dict["state"] = StateT.Start_Stopping
tween_volume = get_tree().create_tween()
tween_volume.tween_property(music_player, "volume_db", -80.0, 4.0)
- tween_volume.tween_callback(start_volume_tween_callback)
+ tween_volume.tween_callback(func():
+ music_player.stop()
+ state_dict["state"] = StateT.MainMenu
+ )
main_label.text = ""
lower_label.text = ""
StateT.Introduction_00:
state_dict["text_idx"] = 0
main_label.text = intro_text_06
StateT.Introduction_06_post:
- state_dict["state"] = StateT.Dungeon_Entrance
+ state_dict["state"] = StateT.Dungeon_Entrance_pre
state_dict["timer"] = 0.0
state_dict["text_idx"] = 0
main_label.text = ""
+ tween_volume = get_tree().create_tween()
+ tween_volume.tween_property(music_player, "volume_db", -80.0, 4.0)
+ tween_volume.tween_callback(func():
+ music_player.stop()
+ state_dict["state"] = StateT.Dungeon_Entrance_loading
+ music_player.volume_db = 0.0
+ )
_:
pass
-
-func start_volume_tween_callback():
- music_player.stop()
- state_dict["state"] = StateT.MainMenu
func diamond_position_update():
fire_diamond.position.x = cos(state_dict["start_diamonds"]["angle"]) * state_dict["start_diamonds"]["dist"]
state_dict["start_diamonds"]["angle"] -= TAU
diamond_position_update()
+
+func camera_to_gander(delta):
+ var diff = gander.position - camera.position
+ if diff.length() > 0.04:
+ var move_vec = diff.normalized() * camera_move_speed * delta
+ if diff.length() < move_vec.length():
+ camera.position = gander.position
+ else:
+ camera.position += move_vec
+ else:
+ camera.position = gander.position