diff --git a/scenes/final_boss/final_boss_intro.tscn b/scenes/final_boss/final_boss_intro.tscn index 79110c5..db29e4e 100644 --- a/scenes/final_boss/final_boss_intro.tscn +++ b/scenes/final_boss/final_boss_intro.tscn @@ -19,8 +19,8 @@ [ext_resource type="Texture2D" uid="uid://dw2k0x26axehh" path="res://assets/sprites/FinalBoss/2 Owlet_Monster/Owlet_hover.png" id="17_ilwv4"] [ext_resource type="Texture2D" uid="uid://dbxk1b30qqnbh" path="res://assets/sprites/FinalBoss/2 Owlet_Monster/Owlet_paunch_4.png" id="18_81ppl"] [ext_resource type="FontFile" uid="uid://cagjx8tuk6q7w" path="res://assets/fonts/PixelifySans-Regular.ttf" id="18_feohv"] -[ext_resource type="Script" path="res://scenes/final_boss/text.gd" id="18_t4lbs"] -[ext_resource type="Script" path="res://scenes/final_boss/text_2.gd" id="20_t4lbs"] +[ext_resource type="Script" uid="uid://cvqbgfg0ehyau" path="res://scenes/final_boss/text.gd" id="18_t4lbs"] +[ext_resource type="Script" uid="uid://cx0jvbc40hlnv" path="res://scenes/final_boss/text_2.gd" id="20_t4lbs"] [ext_resource type="Script" uid="uid://bm1dxf1nbswjl" path="res://scenes/time_level/portal_close.gd" id="21_ilwv4"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_t4lbs"] diff --git a/scenes/final_boss/final_boss_phase1.tscn b/scenes/final_boss/final_boss_phase1.tscn index 450c66d..330ec64 100644 --- a/scenes/final_boss/final_boss_phase1.tscn +++ b/scenes/final_boss/final_boss_phase1.tscn @@ -14,7 +14,7 @@ [ext_resource type="Texture2D" uid="uid://b815dvlwngr8i" path="res://assets/sprites/tilesets/boss_titles_no_pink.png" id="9_mf1nn"] [ext_resource type="Texture2D" uid="uid://djwftmtrtg7pq" path="res://assets/sprites/tilesets/boss_platforms.png" id="10_hpmta"] [ext_resource type="Texture2D" uid="uid://dykbusdobpf3j" path="res://assets/sprites/tilesets/boss_platforms_2.png" id="11_1w4ex"] -[ext_resource type="Script" path="res://scenes/final_boss/text3.gd" id="15_igrjo"] +[ext_resource type="Script" uid="uid://bp8kmc575c88d" path="res://scenes/final_boss/text3.gd" id="15_igrjo"] [ext_resource type="FontFile" uid="uid://cagjx8tuk6q7w" path="res://assets/fonts/PixelifySans-Regular.ttf" id="16_heain"] [sub_resource type="Animation" id="Animation_qvbwd"] diff --git a/scenes/final_boss/final_boss_phase2.tscn b/scenes/final_boss/final_boss_phase2.tscn index ca10bbb..02b3a5b 100644 --- a/scenes/final_boss/final_boss_phase2.tscn +++ b/scenes/final_boss/final_boss_phase2.tscn @@ -2,7 +2,7 @@ [ext_resource type="Texture2D" uid="uid://52hi5k2qufgh" path="res://assets/sprites/backgrounds/final_boss_background2.png" id="1_on63f"] [ext_resource type="Script" uid="uid://qhw12g383nfg" path="res://scenes/final_boss/final_boss_phase_2.gd" id="2_tnine"] -[ext_resource type="Script" path="res://scenes/final_boss/text4.gd" id="3_sc4n8"] +[ext_resource type="Script" uid="uid://drndm57kw20ob" path="res://scenes/final_boss/text4.gd" id="3_sc4n8"] [ext_resource type="PackedScene" uid="uid://1dwenc3ti31r" path="res://scenes/player.tscn" id="3_tdfr6"] [ext_resource type="PackedScene" uid="uid://cor2scf4l42ei" path="res://scenes/tutorial/tutorial_tileset.tscn" id="4_i7g3n"] [ext_resource type="FontFile" uid="uid://cagjx8tuk6q7w" path="res://assets/fonts/PixelifySans-Regular.ttf" id="4_quv1f"] diff --git a/scenes/space/space_2.tscn b/scenes/space/space_2.tscn index 4e943e6..4fc294a 100644 --- a/scenes/space/space_2.tscn +++ b/scenes/space/space_2.tscn @@ -10,7 +10,7 @@ [ext_resource type="PackedScene" uid="uid://3enkgish2037" path="res://scenes/door.tscn" id="7_ahrub"] [ext_resource type="Script" uid="uid://wkdfrke1mkdb" path="res://scenes/space/button_door.gd" id="8_3fosr"] [ext_resource type="Texture2D" uid="uid://cxarlif6ajlvn" path="res://assets/sprites/space/doors.png" id="9_cu557"] -[ext_resource type="Script" path="res://scenes/space/kill_area.gd" id="11_wb43s"] +[ext_resource type="Script" uid="uid://cp8lr8gu8i7hq" path="res://scenes/space/kill_area.gd" id="11_wb43s"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_pntx0"] texture = ExtResource("4_wb43s") diff --git a/scenes/space/space_3.tscn b/scenes/space/space_3.tscn index c619c02..58d9c79 100644 --- a/scenes/space/space_3.tscn +++ b/scenes/space/space_3.tscn @@ -10,7 +10,7 @@ [ext_resource type="Script" uid="uid://wkdfrke1mkdb" path="res://scenes/space/button_door.gd" id="8_qr23u"] [ext_resource type="Texture2D" uid="uid://cxarlif6ajlvn" path="res://assets/sprites/space/doors.png" id="9_2gwxb"] [ext_resource type="PackedScene" uid="uid://3enkgish2037" path="res://scenes/door.tscn" id="10_bpgfv"] -[ext_resource type="Script" path="res://scenes/space/kill_area.gd" id="13_1ytg0"] +[ext_resource type="Script" uid="uid://cp8lr8gu8i7hq" path="res://scenes/space/kill_area.gd" id="13_1ytg0"] [ext_resource type="Script" uid="uid://wydnyp1xj63l" path="res://scenes/space/space_slime.gd" id="14_ogxyq"] [ext_resource type="Texture2D" uid="uid://8kqb5fmdc7yy" path="res://assets/sprites/space/space_slime.png" id="15_ogxyq"] diff --git a/scenes/time_level/time_level_2.tscn b/scenes/time_level/time_level_2.tscn index a240376..c4873e0 100644 --- a/scenes/time_level/time_level_2.tscn +++ b/scenes/time_level/time_level_2.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=39 format=4 uid="uid://b3doeqcd52nu3"] +[gd_scene load_steps=40 format=4 uid="uid://b3doeqcd52nu3"] [ext_resource type="Texture2D" uid="uid://dq50epqb4345c" path="res://assets/sprites/time_level/desert_background.png" id="1_xlol3"] [ext_resource type="Script" uid="uid://cc3efngvlcd0n" path="res://scripts/time_level_2.gd" id="2_0hwx0"] @@ -9,13 +9,14 @@ [ext_resource type="PackedScene" uid="uid://cxt6m0734tqan" path="res://scenes/time_level/coconut.tscn" id="6_hpemy"] [ext_resource type="Texture2D" uid="uid://cgngfxopfhbkm" path="res://assets/sprites/tilesets/tileset_platform_temp.png" id="6_n22yi"] [ext_resource type="Script" uid="uid://cxfugxk14vbvr" path="res://scenes/time_level/kill_zone.gd" id="7_xk3wa"] -[ext_resource type="Script" uid="uid://bbgikxqbo8pof" path="res://scenes/tutorial/enemy_spirit.gd" id="9_5xohw"] [ext_resource type="Texture2D" uid="uid://bo7gs2diwbrjf" path="res://assets/sprites/time_level/coconuthover.png" id="9_wu7qb"] [ext_resource type="Texture2D" uid="uid://ligp2ff8q0yf" path="res://assets/sprites/tutorial/slime_enemy.png" id="10_n22yi"] +[ext_resource type="Script" uid="uid://doceedl5ejqkh" path="res://scenes/tutorial/enemy_spirit_tutorial4.gd" id="11_oq7vi"] [ext_resource type="PackedScene" uid="uid://3enkgish2037" path="res://scenes/door.tscn" id="12_0hwx0"] -[ext_resource type="Script" uid="uid://bho1hy5k11jnk" path="res://scenes/time_level/ability_text_time.gd" id="13_ek4c7"] [ext_resource type="AudioStream" uid="uid://0xde7nio4k78" path="res://assets/audio/soundfx/Enemy-Death_SFX.mp3" id="13_mc3vn"] [ext_resource type="FontFile" uid="uid://cagjx8tuk6q7w" path="res://assets/fonts/PixelifySans-Regular.ttf" id="14_wu7qb"] +[ext_resource type="Script" uid="uid://btyy0e1rjej3s" path="res://scenes/tutorial/text_tutorial_5.gd" id="15_iu2jg"] +[ext_resource type="Script" uid="uid://bpaxufym1fq67" path="res://scenes/tutorial/enemy_death_message.gd" id="17_oq7vi"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_r75vm"] texture = ExtResource("6_n22yi") @@ -317,7 +318,7 @@ length = 0.001 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("Text:visible_ratio") +tracks/0/path = NodePath("Label:visible_ratio") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { @@ -332,7 +333,7 @@ resource_name = "show_tutorial" tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("Text:visible_ratio") +tracks/0/path = NodePath("Label:visible_ratio") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { @@ -396,7 +397,7 @@ shape = SubResource("RectangleShape2D_hpemy") [node name="EnemySpirit" type="Area2D" parent="."] collision_layer = 4 collision_mask = 7 -script = ExtResource("9_5xohw") +script = ExtResource("11_oq7vi") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="EnemySpirit"] position = Vector2(186, 121) @@ -439,10 +440,10 @@ position = Vector2(-15, 140) [node name="Spawn" parent="Doors/Door_W" index="1"] position = Vector2(28, 162) -[node name="AbilityText" type="Node2D" parent="."] -script = ExtResource("13_ek4c7") +[node name="Text" type="Node2D" parent="."] +script = ExtResource("15_iu2jg") -[node name="Text" type="Label" parent="AbilityText"] +[node name="Label" type="Label" parent="Text"] offset_left = 24.0 offset_top = 16.0 offset_right = 2240.0 @@ -460,7 +461,33 @@ horizontal_alignment = 1 visible_characters = 0 visible_ratio = 0.0 -[node name="AnimationPlayer" type="AnimationPlayer" parent="AbilityText"] +[node name="AnimationPlayer" type="AnimationPlayer" parent="Text"] +libraries = { +&"": SubResource("AnimationLibrary_iu2jg") +} + +[node name="EnemyDeathMessage" type="Node2D" parent="."] +script = ExtResource("17_oq7vi") + +[node name="Label" type="Label" parent="EnemyDeathMessage"] +offset_left = 24.0 +offset_top = 16.0 +offset_right = 2240.0 +offset_bottom = 529.0 +scale = Vector2(0.05, 0.05) +theme_override_colors/font_shadow_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_constants/shadow_offset_x = 1 +theme_override_constants/shadow_offset_y = 1 +theme_override_constants/shadow_outline_size = 75 +theme_override_fonts/font = ExtResource("14_wu7qb") +theme_override_font_sizes/font_size = 211 +text = "Got em! Take that, +slime!" +horizontal_alignment = 1 +visible_characters = 0 +visible_ratio = 0.0 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="EnemyDeathMessage"] libraries = { &"": SubResource("AnimationLibrary_iu2jg") } diff --git a/scenes/time_level/timelevel_start.tscn b/scenes/time_level/timelevel_start.tscn index 8d24533..28511cf 100644 --- a/scenes/time_level/timelevel_start.tscn +++ b/scenes/time_level/timelevel_start.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=61 format=4 uid="uid://d1vrlu0l8t8o"] [ext_resource type="Texture2D" uid="uid://dq50epqb4345c" path="res://assets/sprites/time_level/desert_background.png" id="1_qdw5g"] -[ext_resource type="Script" path="res://scenes/time_level/time_level.gd" id="2_q6roq"] +[ext_resource type="Script" uid="uid://cnem844s6ma4p" path="res://scenes/time_level/time_level.gd" id="2_q6roq"] [ext_resource type="PackedScene" uid="uid://1dwenc3ti31r" path="res://scenes/player.tscn" id="3_bridp"] [ext_resource type="PackedScene" uid="uid://cor2scf4l42ei" path="res://scenes/tutorial/tutorial_tileset.tscn" id="4_5n7uh"] [ext_resource type="Texture2D" uid="uid://oqc5cg55jq" path="res://assets/sprites/time_level/Sand Tiles.png" id="5_jemru"] diff --git a/scenes/tutorial/enemy_death_message.gd b/scenes/tutorial/enemy_death_message.gd new file mode 100644 index 0000000..6d284da --- /dev/null +++ b/scenes/tutorial/enemy_death_message.gd @@ -0,0 +1,5 @@ +extends Node2D + +func show_message(): + $Label.visible = true # Show the label (if initially hidden) + $AnimationPlayer.play("show_tutorial") # Play your animation (e.g., fade in or typewriter) diff --git a/scenes/tutorial/enemy_death_message.gd.uid b/scenes/tutorial/enemy_death_message.gd.uid new file mode 100644 index 0000000..cf3b9b5 --- /dev/null +++ b/scenes/tutorial/enemy_death_message.gd.uid @@ -0,0 +1 @@ +uid://bpaxufym1fq67 diff --git a/scenes/tutorial/enemy_spirit_tutorial4.gd b/scenes/tutorial/enemy_spirit_tutorial4.gd new file mode 100644 index 0000000..3e68db2 --- /dev/null +++ b/scenes/tutorial/enemy_spirit_tutorial4.gd @@ -0,0 +1,72 @@ +extends Area2D + # How far to move left and right +@export var move_distance := 10.0 + # How long it takes to move one direction +@export var move_duration := 1 + + # Track direction (1 = right, -1 = left) +var direction := 10 + # Where the enemy started +var start_position := Vector2.ZERO + +func _ready(): + # Save where the enemy begins + start_position = global_position + + # Play idle animation + $AnimatedSprite2D.play("idle") + + # Start the patrol loop + var current_scene = get_tree().current_scene.name + if current_scene == "time_level_2": + start_patrol() + if current_scene == "SpaceCloneEnemy": + start_patrol() + +func start_patrol(): + while true: + # Go left or right from the current position, not the start + var target_position = global_position + Vector2(move_distance * direction, 0) + var tween = create_tween() + tween.tween_property(self, "global_position", target_position, move_duration).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT) + + # Flip the sprite to face the direction + $AnimatedSprite2D.flip_h = direction < 0 + + # Wait for the tween to finish, then switch direction + await tween.finished + direction *= -1 + +func _on_body_entered(body: Node2D) -> void: + if body.name == "Player": + body.die() + await get_tree().create_timer(0.5).timeout # Wait for death animation to finish + get_tree().change_scene_to_file("res://scenes/tutorial/tutorial_5.tscn") + if body is RigidBody2D: + print("Something hit the slime!") + + # Play hit sound effect + # $HitSound.play() + + # Optional: stop log from moving + body.linear_velocity = Vector2.ZERO + + # Wait before deleting (0.3 seconds) + if body.has_method("set_should_respawn"): + body.set_should_respawn(false) + await get_tree().create_timer(0.1).timeout + + # Play death animation + $AnimatedSprite2D.play("death") + + # Wait for animation to finish + await $AnimatedSprite2D.animation_finished + var old_message_node = get_parent().get_node("Text") + old_message_node.hide_message() + var message_node = get_parent().get_node("EnemyDeathMessage") + message_node.show_message() + + # THEN hide and remove both + if is_instance_valid(body): + body.queue_free() + queue_free() diff --git a/scenes/tutorial/enemy_spirit_tutorial4.gd.uid b/scenes/tutorial/enemy_spirit_tutorial4.gd.uid new file mode 100644 index 0000000..940d040 --- /dev/null +++ b/scenes/tutorial/enemy_spirit_tutorial4.gd.uid @@ -0,0 +1 @@ +uid://doceedl5ejqkh diff --git a/scenes/tutorial/text_tutorial_5.gd b/scenes/tutorial/text_tutorial_5.gd new file mode 100644 index 0000000..b129b3f --- /dev/null +++ b/scenes/tutorial/text_tutorial_5.gd @@ -0,0 +1,7 @@ +extends Node2D + +func _ready(): + $AnimationPlayer.play("show_tutorial") + +func hide_message(): + $Label.visible = false diff --git a/scenes/tutorial/text_tutorial_5.gd.uid b/scenes/tutorial/text_tutorial_5.gd.uid new file mode 100644 index 0000000..f0b6d57 --- /dev/null +++ b/scenes/tutorial/text_tutorial_5.gd.uid @@ -0,0 +1 @@ +uid://btyy0e1rjej3s diff --git a/scenes/tutorial/tutorial_3.tscn b/scenes/tutorial/tutorial_3.tscn index d021b1d..c1192d6 100644 --- a/scenes/tutorial/tutorial_3.tscn +++ b/scenes/tutorial/tutorial_3.tscn @@ -182,7 +182,7 @@ position = Vector2(22, 128) [node name="Door_E" parent="Doors" instance=ExtResource("5_fij67")] position = Vector2(320, -4) -destination_level_tag = "tutorial_5" +destination_level_tag = "tutorial_4" destination_door_tag = "W" spawn_direction = "left" diff --git a/scenes/tutorial/tutorial_4.gd b/scenes/tutorial/tutorial_4.gd new file mode 100644 index 0000000..545e156 --- /dev/null +++ b/scenes/tutorial/tutorial_4.gd @@ -0,0 +1,17 @@ +extends TextureRect + +func _ready(): + AudioManager.play_music_tutorial() + + if NavigationManager.spawn_door_tag !=null: + _on_level_spawn(NavigationManager.spawn_door_tag) + +func _on_level_spawn(destination_tag: String): + var door_path = "Doors/Door_" + destination_tag + var door = get_node(door_path) as Door + NavigationManager.trigger_player_spawn(door.spawn.global_position, door.spawn_direction) + +func _on_spike_body_entered(body: Node2D) -> void: + #if body.name == "Player": + if body is Player: + body.die_tutorial_4() diff --git a/scenes/tutorial/tutorial_4.gd.uid b/scenes/tutorial/tutorial_4.gd.uid new file mode 100644 index 0000000..87c4ed4 --- /dev/null +++ b/scenes/tutorial/tutorial_4.gd.uid @@ -0,0 +1 @@ +uid://dk2253v0ai62y diff --git a/scenes/tutorial/tutorial_4.tscn b/scenes/tutorial/tutorial_4.tscn new file mode 100644 index 0000000..c586630 --- /dev/null +++ b/scenes/tutorial/tutorial_4.tscn @@ -0,0 +1,365 @@ +[gd_scene load_steps=35 format=4 uid="uid://bg8j4wpxs24i5"] + +[ext_resource type="Texture2D" uid="uid://b33qkw6qg2a6w" path="res://assets/sprites/backgrounds/forest.png" id="1_eetm0"] +[ext_resource type="Script" uid="uid://dk2253v0ai62y" path="res://scenes/tutorial/tutorial_4.gd" id="2_mxbe0"] +[ext_resource type="PackedScene" uid="uid://1dwenc3ti31r" path="res://scenes/player.tscn" id="3_vy5hl"] +[ext_resource type="PackedScene" uid="uid://cor2scf4l42ei" path="res://scenes/tutorial/tutorial_tileset.tscn" id="4_newk2"] +[ext_resource type="Texture2D" uid="uid://bs1pd6wb3x5xs" path="res://assets/sprites/tutorial/16-bit-spike-Sheet.png" id="5_3c02u"] +[ext_resource type="Texture2D" uid="uid://cgngfxopfhbkm" path="res://assets/sprites/tilesets/tileset_platform_temp.png" id="6_hungi"] +[ext_resource type="Script" uid="uid://doceedl5ejqkh" path="res://scenes/tutorial/enemy_spirit_tutorial4.gd" id="7_mxbe0"] +[ext_resource type="Texture2D" uid="uid://ligp2ff8q0yf" path="res://assets/sprites/tutorial/slime_enemy.png" id="8_cdxu3"] +[ext_resource type="AudioStream" uid="uid://0xde7nio4k78" path="res://assets/audio/soundfx/Enemy-Death_SFX.mp3" id="9_k024x"] +[ext_resource type="PackedScene" uid="uid://3enkgish2037" path="res://scenes/door.tscn" id="11_u1pme"] +[ext_resource type="Script" uid="uid://bho1hy5k11jnk" path="res://scenes/time_level/ability_text_time.gd" id="11_vy5hl"] +[ext_resource type="FontFile" uid="uid://cagjx8tuk6q7w" path="res://assets/fonts/PixelifySans-Regular.ttf" id="12_newk2"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_l264y"] +texture = ExtResource("5_3c02u") +0:0/0 = 0 +1:0/0 = 0 +2:0/0 = 0 +3:0/0 = 0 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_yhrob"] +texture = ExtResource("6_hungi") +0:0/0 = 0 +1:0/0 = 0 +2:0/0 = 0 +3:0/0 = 0 +3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:0/0/physics_layer_0/polygon_0/one_way = true +4:0/0 = 0 +4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:0/0/physics_layer_0/polygon_0/one_way = true +5:0/0 = 0 +5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +5:0/0/physics_layer_0/polygon_0/one_way = true +6:0/0 = 0 +0:1/0 = 0 +1:1/0 = 0 +2:1/0 = 0 +3:1/0 = 0 +4:1/0 = 0 +6:1/0 = 0 +0:2/0 = 0 +1:2/0 = 0 +2:2/0 = 0 +3:2/0 = 0 +4:2/0 = 0 +5:2/0 = 0 +6:2/0 = 0 +0:3/0 = 0 +1:3/0 = 0 +2:3/0 = 0 +3:3/0 = 0 +4:3/0 = 0 +5:3/0 = 0 +6:3/0 = 0 +0:4/0 = 0 +1:4/0 = 0 +2:4/0 = 0 +3:4/0 = 0 +4:4/0 = 0 +5:4/0 = 0 +6:4/0 = 0 +0:5/0 = 0 +1:5/0 = 0 +2:5/0 = 0 +3:5/0 = 0 +4:5/0 = 0 +5:5/0 = 0 +6:5/0 = 0 +0:6/0 = 0 +1:6/0 = 0 +2:6/0 = 0 +3:6/0 = 0 +4:6/0 = 0 +5:6/0 = 0 +6:6/0 = 0 +0:7/0 = 0 +1:7/0 = 0 +2:7/0 = 0 +3:7/0 = 0 +4:7/0 = 0 +5:7/0 = 0 +6:7/0 = 0 +0:8/0 = 0 +1:8/0 = 0 +2:8/0 = 0 +3:8/0 = 0 +4:8/0 = 0 +5:8/0 = 0 +6:8/0 = 0 +0:9/0 = 0 +1:9/0 = 0 +2:9/0 = 0 +3:9/0 = 0 +4:9/0 = 0 +2:10/0 = 0 +3:10/0 = 0 +4:10/0 = 0 + +[sub_resource type="TileSet" id="TileSet_rfyhq"] +physics_layer_0/collision_layer = 1 +sources/6 = SubResource("TileSetAtlasSource_yhrob") +sources/0 = SubResource("TileSetAtlasSource_l264y") + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_7s834"] +size = Vector2(93, 18) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l264y"] +atlas = ExtResource("8_cdxu3") +region = Rect2(128, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yhrob"] +atlas = ExtResource("8_cdxu3") +region = Rect2(160, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b15oi"] +atlas = ExtResource("8_cdxu3") +region = Rect2(192, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jbj40"] +atlas = ExtResource("8_cdxu3") +region = Rect2(224, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6v1co"] +atlas = ExtResource("8_cdxu3") +region = Rect2(0, 32, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vxlaq"] +atlas = ExtResource("8_cdxu3") +region = Rect2(32, 32, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_41v0f"] +atlas = ExtResource("8_cdxu3") +region = Rect2(64, 32, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0jjtv"] +atlas = ExtResource("8_cdxu3") +region = Rect2(96, 32, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yp77c"] +atlas = ExtResource("8_cdxu3") +region = Rect2(128, 32, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7s834"] +atlas = ExtResource("8_cdxu3") +region = Rect2(0, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_86tkr"] +atlas = ExtResource("8_cdxu3") +region = Rect2(32, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2nxha"] +atlas = ExtResource("8_cdxu3") +region = Rect2(64, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i7ey2"] +atlas = ExtResource("8_cdxu3") +region = Rect2(96, 0, 32, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_pu40o"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_l264y") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yhrob") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b15oi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jbj40") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6v1co") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vxlaq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_41v0f") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0jjtv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yp77c") +}], +"loop": false, +"name": &"death", +"speed": 24.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_7s834") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_86tkr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2nxha") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i7ey2") +}], +"loop": true, +"name": &"idle", +"speed": 4.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_i7ey2"] +radius = 44.5533 + +[sub_resource type="Animation" id="Animation_qvbwd"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible_ratio") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_0t1bs"] +resource_name = "show_tutorial" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible_ratio") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(2.2974, 1), +"update": 0, +"values": [0.0, 1.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_qpase"] +_data = { +&"RESET": SubResource("Animation_qvbwd"), +&"show_tutorial": SubResource("Animation_0t1bs") +} + +[node name="TutorialEnemy" type="TextureRect"] +z_index = 1 +custom_minimum_size = Vector2(320, 180) +offset_top = 1.0 +offset_right = 320.0 +offset_bottom = 181.0 +texture = ExtResource("1_eetm0") +expand_mode = 1 +script = ExtResource("2_mxbe0") + +[node name="Player" parent="." instance=ExtResource("3_vy5hl")] +collision_layer = 2 + +[node name="Floor" parent="." instance=ExtResource("4_newk2")] + +[node name="Platforms" type="TileMapLayer" parent="."] +tile_map_data = PackedByteArray("AAAVAAAABgACAAEAAAAVAAEABgACAAEAAAAVAAIABgACAAEAAAAVAAQABgACAAEAAAAVAAUABgACAAEAAAAVAAYABgACAAEAAAAVAAcABgACAAEAAAAVAAgABgACAAEAAAAVAAkABgACAAEAAAAVAAoABgACAAEAAAAVAAsABgACAAEAAAAFAAgAAAAAAAAAAAAGAAgAAAAAAAAAAAAHAAgAAAAAAAAAAAAIAAgAAAAAAAAAAAAJAAgAAAAAAAAAAAAKAAgAAAAAAAAAAAAVAAMABgACAAEAAAAFAAYABgADAAAAAAAGAAYABgAFAAAAAAAJAAQABgAEAAAAAAAIAAQABgADAAAAAAAKAAQABgAFAAAAAAD+/woABgAAAAEAAAD+/wkABgAAAAEAAAD+/wgABgAAAAEAAAD+/wcABgAAAAEAAAD+/wYABgAAAAEAAAD+/wUABgAAAAEAAAD+/wQABgAAAAEAAAD+/wMABgAAAAEAAAD+/wIABgAAAAEAAAD+/wEABgAAAAEAAAD+/wAABgAAAAEAAAAOAAQABgADAAAAAAAPAAQABgAEAAAAAAAQAAQABgAEAAAAAAARAAQABgAEAAAAAAASAAQABgAEAAAAAAATAAQABgAEAAAAAAAUAAQABgAFAAAAAAAOAAMAAAAAAAAAAAAQAAMAAAAAAAAAAAARAAMAAAAAAAAAAAASAAMAAAAAAAAAAAATAAMAAAAAAAAAAAAUAAMAAAAAAAAAAAAPAAMAAAAAAAAAAAA=") +tile_set = SubResource("TileSet_rfyhq") + +[node name="Spike" type="Area2D" parent="Platforms"] +position = Vector2(65, 98) +collision_mask = 7 + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="Platforms/Spike"] +position = Vector2(208, -41) +shape = SubResource("RectangleShape2D_7s834") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Platforms/Spike"] +position = Vector2(61.5, 38) +shape = SubResource("RectangleShape2D_7s834") + +[node name="PlayerSpawn" type="Node2D" parent="."] +position = Vector2(34, 130) + +[node name="EnemySpirit" type="Area2D" parent="."] +collision_layer = 4 +collision_mask = 7 +script = ExtResource("7_mxbe0") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="EnemySpirit"] +position = Vector2(215, 118) +scale = Vector2(2.66846, 2.98438) +sprite_frames = SubResource("SpriteFrames_pu40o") +animation = &"death" +frame = 8 +frame_progress = 1.0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemySpirit"] +position = Vector2(218, 128) +shape = SubResource("CircleShape2D_i7ey2") + +[node name="HitSound" type="AudioStreamPlayer2D" parent="EnemySpirit"] +stream = ExtResource("9_k024x") + +[node name="Doors" type="Node" parent="."] + +[node name="Door_W" parent="Doors" instance=ExtResource("11_u1pme")] +position = Vector2(0, -7) +collision_mask = 7 +destination_level_tag = "tutorial_3" +destination_door_tag = "E" +spawn_direction = "right" + +[node name="CollisionShape2D" parent="Doors/Door_W" index="0"] +position = Vector2(3, 121) + +[node name="Spawn" parent="Doors/Door_W" index="1"] +position = Vector2(35, 138) + +[node name="Door_E" parent="Doors" instance=ExtResource("11_u1pme")] +position = Vector2(331, -18) +collision_mask = 7 +destination_level_tag = "tutorial_5" +destination_door_tag = "W" +spawn_direction = "left" + +[node name="CollisionShape2D" parent="Doors/Door_E" index="0"] +position = Vector2(-11, 129) + +[node name="Spawn" parent="Doors/Door_E" index="1"] +position = Vector2(-32, 134) + +[node name="Text" type="Node2D" parent="."] +script = ExtResource("11_vy5hl") + +[node name="Label" type="Label" parent="Text"] +offset_left = 16.0 +offset_top = 8.0 +offset_right = 3105.0 +offset_bottom = 1350.0 +scale = Vector2(0.05, 0.05) +theme_override_colors/font_shadow_color = Color(0.374139, 0.374139, 0.374139, 1) +theme_override_constants/shadow_offset_x = 1 +theme_override_constants/shadow_offset_y = 1 +theme_override_constants/shadow_outline_size = 72 +theme_override_fonts/font = ExtResource("12_newk2") +theme_override_font_sizes/font_size = 221 +text = "Hmm... where do we go?" +visible_characters = 0 +visible_ratio = 0.0 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Text"] +root_node = NodePath("../Label") +libraries = { +&"": SubResource("AnimationLibrary_qpase") +} + +[connection signal="body_entered" from="Platforms/Spike" to="." method="_on_spike_body_entered"] +[connection signal="body_entered" from="EnemySpirit" to="." method="_on_enemy_spirit_body_entered"] +[connection signal="body_entered" from="EnemySpirit" to="EnemySpirit" method="_on_body_entered"] + +[editable path="Doors/Door_W"] +[editable path="Doors/Door_E"] diff --git a/scenes/tutorial/tutorial_5.tscn b/scenes/tutorial/tutorial_5.tscn index f214848..e808851 100644 --- a/scenes/tutorial/tutorial_5.tscn +++ b/scenes/tutorial/tutorial_5.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=32 format=4 uid="uid://bj6dgr7fiae4s"] +[gd_scene load_steps=38 format=4 uid="uid://bj6dgr7fiae4s"] [ext_resource type="Texture2D" uid="uid://b33qkw6qg2a6w" path="res://assets/sprites/backgrounds/forest.png" id="1_uqtl2"] [ext_resource type="Script" uid="uid://bc3txq5k7s8cd" path="res://scripts/tutorial.gd" id="2_76njk"] @@ -6,11 +6,14 @@ [ext_resource type="PackedScene" uid="uid://cor2scf4l42ei" path="res://scenes/tutorial/tutorial_tileset.tscn" id="4_86tkr"] [ext_resource type="Texture2D" uid="uid://cgngfxopfhbkm" path="res://assets/sprites/tilesets/tileset_platform_temp.png" id="5_2nxha"] [ext_resource type="Texture2D" uid="uid://bs1pd6wb3x5xs" path="res://assets/sprites/tutorial/16-bit-spike-Sheet.png" id="6_76njk"] +[ext_resource type="Script" uid="uid://doceedl5ejqkh" path="res://scenes/tutorial/enemy_spirit_tutorial4.gd" id="7_6v1co"] [ext_resource type="Texture2D" uid="uid://ligp2ff8q0yf" path="res://assets/sprites/tutorial/slime_enemy.png" id="7_7s834"] -[ext_resource type="Script" uid="uid://bbgikxqbo8pof" path="res://scenes/tutorial/enemy_spirit.gd" id="7_86tkr"] [ext_resource type="Texture2D" uid="uid://cnm7sr43nwnmb" path="res://assets/sprites/tutorial/log.png" id="9_2nxha"] [ext_resource type="AudioStream" uid="uid://0xde7nio4k78" path="res://assets/audio/soundfx/Enemy-Death_SFX.mp3" id="9_yhrob"] [ext_resource type="PackedScene" uid="uid://3enkgish2037" path="res://scenes/door.tscn" id="10_i7ey2"] +[ext_resource type="Script" uid="uid://btyy0e1rjej3s" path="res://scenes/tutorial/text_tutorial_5.gd" id="12_6v1co"] +[ext_resource type="FontFile" uid="uid://cagjx8tuk6q7w" path="res://assets/fonts/PixelifySans-Regular.ttf" id="13_6v1co"] +[ext_resource type="Script" uid="uid://bpaxufym1fq67" path="res://scenes/tutorial/enemy_death_message.gd" id="14_6v1co"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_l264y"] texture = ExtResource("6_76njk") @@ -216,6 +219,42 @@ radius = 44.5533 [sub_resource type="RectangleShape2D" id="RectangleShape2D_i7ey2"] size = Vector2(26, 14) +[sub_resource type="Animation" id="Animation_qvbwd"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible_ratio") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_0t1bs"] +resource_name = "show_tutorial" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:visible_ratio") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(2.2974, 1), +"update": 0, +"values": [0.0, 1.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_qpase"] +_data = { +&"RESET": SubResource("Animation_qvbwd"), +&"show_tutorial": SubResource("Animation_0t1bs") +} + [node name="TutorialEnemy" type="TextureRect"] z_index = 1 custom_minimum_size = Vector2(320, 180) @@ -253,7 +292,7 @@ position = Vector2(34, 130) [node name="EnemySpirit" type="Area2D" parent="."] collision_layer = 4 collision_mask = 7 -script = ExtResource("7_86tkr") +script = ExtResource("7_6v1co") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="EnemySpirit"] position = Vector2(215, 118) @@ -312,6 +351,59 @@ position = Vector2(-11, 129) [node name="Spawn" parent="Doors/Door_E" index="1"] position = Vector2(-32, 134) +[node name="Text" type="Node2D" parent="."] +script = ExtResource("12_6v1co") + +[node name="Label" type="Label" parent="Text"] +offset_left = 16.0 +offset_top = 8.0 +offset_right = 3105.0 +offset_bottom = 1350.0 +scale = Vector2(0.05, 0.05) +theme_override_colors/font_shadow_color = Color(0.374139, 0.374139, 0.374139, 1) +theme_override_constants/shadow_offset_x = 1 +theme_override_constants/shadow_offset_y = 1 +theme_override_constants/shadow_outline_size = 72 +theme_override_fonts/font = ExtResource("13_6v1co") +theme_override_font_sizes/font_size = 221 +text = "Let's try that again. +Here's something to help you out." +visible_characters = 0 +visible_ratio = 0.0 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Text"] +root_node = NodePath("../Label") +libraries = { +&"": SubResource("AnimationLibrary_qpase") +} + +[node name="EnemyDeathMessage" type="Node2D" parent="."] +script = ExtResource("14_6v1co") + +[node name="Label" type="Label" parent="EnemyDeathMessage"] +offset_left = 16.0 +offset_top = 8.0 +offset_right = 3105.0 +offset_bottom = 1350.0 +scale = Vector2(0.05, 0.05) +theme_override_colors/font_shadow_color = Color(0.374139, 0.374139, 0.374139, 1) +theme_override_constants/shadow_offset_x = 1 +theme_override_constants/shadow_offset_y = 1 +theme_override_constants/shadow_outline_size = 72 +theme_override_fonts/font = ExtResource("13_6v1co") +theme_override_font_sizes/font_size = 221 +text = "Nice work! Use your wits and surroundings + to defeat creatures that +get in your way." +visible_characters = 0 +visible_ratio = 0.0 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="EnemyDeathMessage"] +root_node = NodePath("../Label") +libraries = { +&"": SubResource("AnimationLibrary_qpase") +} + [connection signal="body_entered" from="Platforms/Spike" to="." method="_on_spike_body_entered"] [connection signal="body_entered" from="EnemySpirit" to="." method="_on_enemy_spirit_body_entered"] [connection signal="body_entered" from="EnemySpirit" to="EnemySpirit" method="_on_body_entered"] diff --git a/scripts/navigation_manager.gd b/scripts/navigation_manager.gd index a9ddee5..8404292 100644 --- a/scripts/navigation_manager.gd +++ b/scripts/navigation_manager.gd @@ -3,6 +3,7 @@ extends Node const scene_tutorial1 = preload("res://scenes/tutorial/tutorial_1.tscn") const scene_tutorial2 = preload("res://scenes/tutorial/tutorial_2.tscn") const scene_tutorial3 = preload("res://scenes/tutorial/tutorial_3.tscn") +const scene_tutorial4 = preload("res://scenes/tutorial/tutorial_4.tscn") const scene_tutorial5 = preload("res://scenes/tutorial/tutorial_5.tscn") const scene_tutorial6 = preload("res://scenes/tutorial/tutorial_6.tscn") @@ -42,6 +43,8 @@ func go_to_level(level_tag, destination_tag): scene_to_load = scene_tutorial2 "tutorial_3": scene_to_load = scene_tutorial3 + "tutorial_4": + scene_to_load = scene_tutorial4 "tutorial_5": scene_to_load = scene_tutorial5 "tutorial_6": diff --git a/scripts/player_movement.gd b/scripts/player_movement.gd index 003501d..7101fa8 100644 --- a/scripts/player_movement.gd +++ b/scripts/player_movement.gd @@ -150,6 +150,18 @@ func die(): reset_time_slow() SceneManager.reload_scene_after_delay(0.7) # Tell the scene manager to reload after 1 second +func die_tutorial_4(): + if not is_inside_tree(): + return + time_slow_cooldown = 1.0 + if has_node("AnimatedSprite2D"): + $AnimatedSprite2D.play("death") + set_physics_process(false) + if has_method("reset_time_slow"): + reset_time_slow() + await get_tree().create_timer(0.7).timeout + get_tree().change_scene_to_file("res://scenes/tutorial/tutorial_5.tscn") + func _input(event : InputEvent): if(event.is_action_pressed("down")): position.y += 1