diff --git a/GUI/Pause Screen.gd b/GUI/Pause Screen.gd index d719c6b..aeb7345 100644 --- a/GUI/Pause Screen.gd +++ b/GUI/Pause Screen.gd @@ -1,11 +1,28 @@ extends CanvasLayer +export var hub_world_path: String = 'res://Levels/Hub World.tscn' +export var disable_back_to_hub: bool = false + + +func _ready() -> void: + if disable_back_to_hub: + $'Menu/Menu Options/Back To Hub'.visible = false + return + func _on_resume_button_pressed() -> void: resume() return +func _on_back_to_hub_button_pressed(): + if get_tree().change_scene(hub_world_path) != OK: + print('ERROR: Pause Screen failed to change scene to Hub World.') + resume() + queue_free() + return + + func _on_quit_button_pressed() -> void: get_tree().quit() return @@ -16,6 +33,11 @@ func _on_resume_button_mouse_entered() -> void: return +func _on_back_to_hub_button_mouse_entered() -> void: + $'Menu Button Hover'.play(0.0) + return + + func _on_quit_button_mouse_entered() -> void: $'Menu Button Hover'.play(0.0) return diff --git a/GUI/Pause Screen.tscn b/GUI/Pause Screen.tscn index d72ad68..284d75a 100644 --- a/GUI/Pause Screen.tscn +++ b/GUI/Pause Screen.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1] [ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Normal.png" type="Texture" id=2] @@ -7,6 +7,8 @@ [ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Hover.png" type="Texture" id=5] [ext_resource path="res://GUI/Pause Screen.gd" type="Script" id=6] [ext_resource path="res://Sounds/Menu_Button_Hover.wav" type="AudioStream" id=7] +[ext_resource path="res://Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png" type="Texture" id=8] +[ext_resource path="res://Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png" type="Texture" id=9] [node name="Pause Screen" type="CanvasLayer"] pause_mode = 2 @@ -34,10 +36,10 @@ __meta__ = { } [node name="Menu Options" type="VBoxContainer" parent="Menu"] -margin_left = 49.0 -margin_top = 63.0 -margin_right = 111.0 -margin_bottom = 97.0 +margin_left = 33.0 +margin_top = 53.0 +margin_right = 126.0 +margin_bottom = 106.0 [node name="Resume" type="CenterContainer" parent="Menu/Menu Options"] margin_right = 62.0 @@ -49,6 +51,17 @@ margin_bottom = 15.0 texture_normal = ExtResource( 3 ) texture_hover = ExtResource( 4 ) +[node name="Back To Hub" type="CenterContainer" parent="Menu/Menu Options"] +margin_right = 40.0 +margin_bottom = 40.0 + +[node name="Back To Hub Button" type="TextureButton" parent="Menu/Menu Options/Back To Hub"] +margin_top = 12.0 +margin_right = 93.0 +margin_bottom = 27.0 +texture_normal = ExtResource( 8 ) +texture_hover = ExtResource( 9 ) + [node name="Quit" type="CenterContainer" parent="Menu/Menu Options"] margin_top = 19.0 margin_right = 62.0 @@ -67,5 +80,7 @@ volume_db = -16.0 [connection signal="mouse_entered" from="Menu/Menu Options/Resume/Resume Button" to="." method="_on_resume_button_mouse_entered"] [connection signal="pressed" from="Menu/Menu Options/Resume/Resume Button" to="." method="_on_resume_button_pressed"] +[connection signal="mouse_entered" from="Menu/Menu Options/Back To Hub/Back To Hub Button" to="." method="_on_back_to_hub_button_mouse_entered"] +[connection signal="pressed" from="Menu/Menu Options/Back To Hub/Back To Hub Button" to="." method="_on_back_to_hub_button_pressed"] [connection signal="mouse_entered" from="Menu/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_mouse_entered"] [connection signal="pressed" from="Menu/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_pressed"] diff --git a/Levels/Hub World.gd b/Levels/Hub World.gd index 5c4d9ab..5cc2f7c 100644 --- a/Levels/Hub World.gd +++ b/Levels/Hub World.gd @@ -2,5 +2,16 @@ extends Node2D func _ready() -> void: - $YSort/Player.load_hud($HUD) - return + $YSort/Player.load_hud($HUD) + + for level_portal in $'YSort/Level Portals'.get_children(): + if level_portal.connect('enter_level', self, 'enter_level') != OK: + print('ERROR: Level Portal "enter_level" signal already connected.') + return + + +func enter_level(level: String) -> void: + if get_tree().change_scene(level) != OK: + print('ERROR: Hub World failed to change scene to Level.') + queue_free() + return diff --git a/Levels/Hub World.tscn b/Levels/Hub World.tscn index 057a9c1..8e60546 100644 --- a/Levels/Hub World.tscn +++ b/Levels/Hub World.tscn @@ -1,18 +1,127 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1] [ext_resource path="res://Levels/Hub World.gd" type="Script" id=2] [ext_resource path="res://GUI/HUD.tscn" type="PackedScene" id=3] [ext_resource path="res://GUI/Pause Screen.tscn" type="PackedScene" id=4] +[ext_resource path="res://Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png" type="Texture" id=5] +[ext_resource path="res://Sprites/Assets/Black_Tile.png" type="Texture" id=6] +[ext_resource path="res://Levels/Interactables/Level Portal.tscn" type="PackedScene" id=7] + +[sub_resource type="ConvexPolygonShape2D" id=2] +points = PoolVector2Array( 0, 0, 2, 0, 2, 2, 0, 2 ) + +[sub_resource type="TileSet" id=3] +0/name = "Boundary Tile" +0/texture = ExtResource( 6 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 2, 2 ) +0/tile_mode = 0 +0/occluder_offset = Vector2( 0, 0 ) +0/navigation_offset = Vector2( 0, 0 ) +0/shape_offset = Vector2( 0, 0 ) +0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +0/shape = SubResource( 2 ) +0/shape_one_way = false +0/shape_one_way_margin = 1.0 +0/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 2 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +0/z_index = 0 + +[sub_resource type="TileSet" id=1] +0/name = "Hub_World_Grass_Atlas.png 0" +0/texture = ExtResource( 5 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 256, 128 ) +0/tile_mode = 2 +0/autotile/icon_coordinate = Vector2( 5, 3 ) +0/autotile/tile_size = Vector2( 32, 32 ) +0/autotile/spacing = 0 +0/autotile/occluder_map = [ ] +0/autotile/navpoly_map = [ ] +0/autotile/priority_map = [ Vector3( 0, 0, 2 ), Vector3( 0, 1, 2 ), Vector3( 0, 2, 2 ), Vector3( 0, 3, 2 ), Vector3( 1, 0, 2 ), Vector3( 1, 1, 2 ), Vector3( 1, 2, 2 ), Vector3( 1, 3, 2 ), Vector3( 2, 0, 2 ), Vector3( 2, 1, 2 ), Vector3( 2, 2, 2 ), Vector3( 2, 3, 2 ), Vector3( 3, 0, 2 ), Vector3( 3, 1, 2 ), Vector3( 3, 2, 2 ), Vector3( 3, 3, 2 ) ] +0/autotile/z_index_map = [ ] +0/occluder_offset = Vector2( 0, 0 ) +0/navigation_offset = Vector2( 0, 0 ) +0/shape_offset = Vector2( 0, 0 ) +0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +0/shape_one_way = false +0/shape_one_way_margin = 0.0 +0/shapes = [ ] +0/z_index = 0 [node name="Hub World" type="Node2D"] script = ExtResource( 2 ) +[node name="Boundary" type="TileMap" parent="."] +light_mask = 0 +tile_set = SubResource( 3 ) +cell_size = Vector2( 2, 2 ) +cell_quadrant_size = 64 +show_collision = true +collision_mask = 0 +occluder_light_mask = 0 +format = 1 +tile_data = PoolIntArray( -1, 0, 0, -65536, 0, 0, -65535, 0, 0, -65534, 0, 0, -65533, 0, 0, -65532, 0, 0, -65531, 0, 0, -65530, 0, 0, -65529, 0, 0, -65528, 0, 0, -65527, 0, 0, -65526, 0, 0, -65525, 0, 0, -65524, 0, 0, -65523, 0, 0, -65522, 0, 0, -65521, 0, 0, -65520, 0, 0, -65519, 0, 0, -65518, 0, 0, -65517, 0, 0, -65516, 0, 0, -65515, 0, 0, -65514, 0, 0, -65513, 0, 0, -65512, 0, 0, -65511, 0, 0, -65510, 0, 0, -65509, 0, 0, -65508, 0, 0, -65507, 0, 0, -65506, 0, 0, -65505, 0, 0, -65504, 0, 0, -65503, 0, 0, -65502, 0, 0, -65501, 0, 0, -65500, 0, 0, -65499, 0, 0, -65498, 0, 0, -65497, 0, 0, -65496, 0, 0, -65495, 0, 0, -65494, 0, 0, -65493, 0, 0, -65492, 0, 0, -65491, 0, 0, -65490, 0, 0, -65489, 0, 0, -65488, 0, 0, -65487, 0, 0, -65486, 0, 0, -65485, 0, 0, -65484, 0, 0, -65483, 0, 0, -65482, 0, 0, -65481, 0, 0, -65480, 0, 0, -65479, 0, 0, -65478, 0, 0, -65477, 0, 0, -65476, 0, 0, -65475, 0, 0, -65474, 0, 0, -65473, 0, 0, -65472, 0, 0, -65471, 0, 0, -65470, 0, 0, -65469, 0, 0, -65468, 0, 0, -65467, 0, 0, -65466, 0, 0, -65465, 0, 0, -65464, 0, 0, -65463, 0, 0, -65462, 0, 0, -65461, 0, 0, -65460, 0, 0, -65459, 0, 0, -65458, 0, 0, -65457, 0, 0, -65456, 0, 0, -65455, 0, 0, -65454, 0, 0, -65453, 0, 0, -65452, 0, 0, -65451, 0, 0, -65450, 0, 0, -65449, 0, 0, -65448, 0, 0, -65447, 0, 0, -65446, 0, 0, -65445, 0, 0, -65444, 0, 0, -65443, 0, 0, -65442, 0, 0, -65441, 0, 0, -65440, 0, 0, -65439, 0, 0, -65438, 0, 0, -65437, 0, 0, -65436, 0, 0, -65435, 0, 0, -65434, 0, 0, -65433, 0, 0, -65432, 0, 0, -65431, 0, 0, -65430, 0, 0, -65429, 0, 0, -65428, 0, 0, -65427, 0, 0, -65426, 0, 0, -65425, 0, 0, -65424, 0, 0, -65423, 0, 0, -65422, 0, 0, -65421, 0, 0, -65420, 0, 0, -65419, 0, 0, -65418, 0, 0, -65417, 0, 0, -65416, 0, 0, -65415, 0, 0, -65414, 0, 0, -65413, 0, 0, -65412, 0, 0, -65411, 0, 0, -65410, 0, 0, -65409, 0, 0, -65408, 0, 0, -65407, 0, 0, -65406, 0, 0, -65405, 0, 0, -65404, 0, 0, -65403, 0, 0, -65402, 0, 0, -65401, 0, 0, -65400, 0, 0, -65399, 0, 0, -65398, 0, 0, -65397, 0, 0, -65396, 0, 0, -65395, 0, 0, -65394, 0, 0, -65393, 0, 0, -65392, 0, 0, -65391, 0, 0, -65390, 0, 0, -65389, 0, 0, -65388, 0, 0, -65387, 0, 0, -65386, 0, 0, -65385, 0, 0, -65384, 0, 0, -65383, 0, 0, -65382, 0, 0, -65381, 0, 0, -65380, 0, 0, -65379, 0, 0, -65378, 0, 0, -65377, 0, 0, -65376, 0, 0, -65375, 0, 0, -65374, 0, 0, -65373, 0, 0, -65372, 0, 0, -65371, 0, 0, -65370, 0, 0, -65369, 0, 0, -65368, 0, 0, -65367, 0, 0, -65366, 0, 0, -65365, 0, 0, -65364, 0, 0, -65363, 0, 0, -65362, 0, 0, -65361, 0, 0, -65360, 0, 0, -65359, 0, 0, -65358, 0, 0, -65357, 0, 0, -65356, 0, 0, -65355, 0, 0, -65354, 0, 0, -65353, 0, 0, -65352, 0, 0, -65351, 0, 0, -65350, 0, 0, -65349, 0, 0, -65348, 0, 0, -65347, 0, 0, -65346, 0, 0, -65345, 0, 0, -65344, 0, 0, 65535, 0, 0, 192, 0, 0, 131071, 0, 0, 65728, 0, 0, 196607, 0, 0, 131264, 0, 0, 262143, 0, 0, 196800, 0, 0, 327679, 0, 0, 262336, 0, 0, 393215, 0, 0, 327872, 0, 0, 458751, 0, 0, 393408, 0, 0, 524287, 0, 0, 458944, 0, 0, 589823, 0, 0, 524480, 0, 0, 655359, 0, 0, 590016, 0, 0, 720895, 0, 0, 655552, 0, 0, 786431, 0, 0, 721088, 0, 0, 851967, 0, 0, 786624, 0, 0, 917503, 0, 0, 852160, 0, 0, 983039, 0, 0, 917696, 0, 0, 1048575, 0, 0, 983232, 0, 0, 1114111, 0, 0, 1048768, 0, 0, 1179647, 0, 0, 1114304, 0, 0, 1245183, 0, 0, 1179840, 0, 0, 1310719, 0, 0, 1245376, 0, 0, 1376255, 0, 0, 1310912, 0, 0, 1441791, 0, 0, 1376448, 0, 0, 1507327, 0, 0, 1441984, 0, 0, 1572863, 0, 0, 1507520, 0, 0, 1638399, 0, 0, 1573056, 0, 0, 1703935, 0, 0, 1638592, 0, 0, 1769471, 0, 0, 1704128, 0, 0, 1835007, 0, 0, 1769664, 0, 0, 1900543, 0, 0, 1835200, 0, 0, 1966079, 0, 0, 1900736, 0, 0, 2031615, 0, 0, 1966272, 0, 0, 2097151, 0, 0, 2031808, 0, 0, 2162687, 0, 0, 2097344, 0, 0, 2228223, 0, 0, 2162880, 0, 0, 2293759, 0, 0, 2228416, 0, 0, 2359295, 0, 0, 2293952, 0, 0, 2424831, 0, 0, 2359488, 0, 0, 2490367, 0, 0, 2425024, 0, 0, 2555903, 0, 0, 2490560, 0, 0, 2621439, 0, 0, 2556096, 0, 0, 2686975, 0, 0, 2621632, 0, 0, 2752511, 0, 0, 2687168, 0, 0, 2818047, 0, 0, 2752704, 0, 0, 2883583, 0, 0, 2818240, 0, 0, 2949119, 0, 0, 2883776, 0, 0, 3014655, 0, 0, 2949312, 0, 0, 3080191, 0, 0, 3014848, 0, 0, 3145727, 0, 0, 3080384, 0, 0, 3211263, 0, 0, 3145920, 0, 0, 3276799, 0, 0, 3211456, 0, 0, 3342335, 0, 0, 3276992, 0, 0, 3407871, 0, 0, 3342528, 0, 0, 3473407, 0, 0, 3408064, 0, 0, 3538943, 0, 0, 3473600, 0, 0, 3604479, 0, 0, 3539136, 0, 0, 3670015, 0, 0, 3604672, 0, 0, 3735551, 0, 0, 3670208, 0, 0, 3801087, 0, 0, 3735744, 0, 0, 3866623, 0, 0, 3801280, 0, 0, 3932159, 0, 0, 3866816, 0, 0, 3997695, 0, 0, 3932352, 0, 0, 4063231, 0, 0, 3997888, 0, 0, 4128767, 0, 0, 4063424, 0, 0, 4194303, 0, 0, 4128960, 0, 0, 4259839, 0, 0, 4194496, 0, 0, 4325375, 0, 0, 4260032, 0, 0, 4390911, 0, 0, 4325568, 0, 0, 4456447, 0, 0, 4391104, 0, 0, 4521983, 0, 0, 4456640, 0, 0, 4587519, 0, 0, 4522176, 0, 0, 4653055, 0, 0, 4587712, 0, 0, 4718591, 0, 0, 4653248, 0, 0, 4784127, 0, 0, 4718784, 0, 0, 4849663, 0, 0, 4784320, 0, 0, 4915199, 0, 0, 4849856, 0, 0, 4980735, 0, 0, 4915392, 0, 0, 5046271, 0, 0, 4980928, 0, 0, 5111807, 0, 0, 5046464, 0, 0, 5177343, 0, 0, 5112000, 0, 0, 5242879, 0, 0, 5177536, 0, 0, 5308415, 0, 0, 5243072, 0, 0, 5373951, 0, 0, 5308608, 0, 0, 5439487, 0, 0, 5374144, 0, 0, 5505023, 0, 0, 5439680, 0, 0, 5570559, 0, 0, 5505216, 0, 0, 5636095, 0, 0, 5570752, 0, 0, 5701631, 0, 0, 5636288, 0, 0, 5767167, 0, 0, 5701824, 0, 0, 5832703, 0, 0, 5767360, 0, 0, 5898239, 0, 0, 5832896, 0, 0, 5963775, 0, 0, 5898432, 0, 0, 6029311, 0, 0, 5963968, 0, 0, 6094847, 0, 0, 6029504, 0, 0, 6160383, 0, 0, 6095040, 0, 0, 6225919, 0, 0, 6160576, 0, 0, 6291455, 0, 0, 6226112, 0, 0, 6356991, 0, 0, 6291648, 0, 0, 6422527, 0, 0, 6357184, 0, 0, 6488063, 0, 0, 6422720, 0, 0, 6553599, 0, 0, 6488256, 0, 0, 6619135, 0, 0, 6553792, 0, 0, 6684671, 0, 0, 6619328, 0, 0, 6750207, 0, 0, 6684864, 0, 0, 6815743, 0, 0, 6750400, 0, 0, 6881279, 0, 0, 6815936, 0, 0, 6946815, 0, 0, 6881472, 0, 0, 7012351, 0, 0, 6947008, 0, 0, 7077887, 0, 0, 7012544, 0, 0, 7143423, 0, 0, 7078080, 0, 0, 7208959, 0, 0, 7143616, 0, 0, 7274495, 0, 0, 7209152, 0, 0, 7340031, 0, 0, 7274688, 0, 0, 7405567, 0, 0, 7340224, 0, 0, 7471103, 0, 0, 7405760, 0, 0, 7536639, 0, 0, 7471296, 0, 0, 7602175, 0, 0, 7536832, 0, 0, 7667711, 0, 0, 7602368, 0, 0, 7733247, 0, 0, 7667904, 0, 0, 7798783, 0, 0, 7733440, 0, 0, 7864319, 0, 0, 7798976, 0, 0, 7929855, 0, 0, 7864512, 0, 0, 7995391, 0, 0, 7930048, 0, 0, 8060927, 0, 0, 7995584, 0, 0, 8126463, 0, 0, 8061120, 0, 0, 8191999, 0, 0, 8126656, 0, 0, 8257535, 0, 0, 8192192, 0, 0, 8323071, 0, 0, 8257728, 0, 0, 8388607, 0, 0, 8323264, 0, 0, 8454143, 0, 0, 8388608, 0, 0, 8388609, 0, 0, 8388610, 0, 0, 8388611, 0, 0, 8388612, 0, 0, 8388613, 0, 0, 8388614, 0, 0, 8388615, 0, 0, 8388616, 0, 0, 8388617, 0, 0, 8388618, 0, 0, 8388619, 0, 0, 8388620, 0, 0, 8388621, 0, 0, 8388622, 0, 0, 8388623, 0, 0, 8388624, 0, 0, 8388625, 0, 0, 8388626, 0, 0, 8388627, 0, 0, 8388628, 0, 0, 8388629, 0, 0, 8388630, 0, 0, 8388631, 0, 0, 8388632, 0, 0, 8388633, 0, 0, 8388634, 0, 0, 8388635, 0, 0, 8388636, 0, 0, 8388637, 0, 0, 8388638, 0, 0, 8388639, 0, 0, 8388640, 0, 0, 8388641, 0, 0, 8388642, 0, 0, 8388643, 0, 0, 8388644, 0, 0, 8388645, 0, 0, 8388646, 0, 0, 8388647, 0, 0, 8388648, 0, 0, 8388649, 0, 0, 8388650, 0, 0, 8388651, 0, 0, 8388652, 0, 0, 8388653, 0, 0, 8388654, 0, 0, 8388655, 0, 0, 8388656, 0, 0, 8388657, 0, 0, 8388658, 0, 0, 8388659, 0, 0, 8388660, 0, 0, 8388661, 0, 0, 8388662, 0, 0, 8388663, 0, 0, 8388664, 0, 0, 8388665, 0, 0, 8388666, 0, 0, 8388667, 0, 0, 8388668, 0, 0, 8388669, 0, 0, 8388670, 0, 0, 8388671, 0, 0, 8388672, 0, 0, 8388673, 0, 0, 8388674, 0, 0, 8388675, 0, 0, 8388676, 0, 0, 8388677, 0, 0, 8388678, 0, 0, 8388679, 0, 0, 8388680, 0, 0, 8388681, 0, 0, 8388682, 0, 0, 8388683, 0, 0, 8388684, 0, 0, 8388685, 0, 0, 8388686, 0, 0, 8388687, 0, 0, 8388688, 0, 0, 8388689, 0, 0, 8388690, 0, 0, 8388691, 0, 0, 8388692, 0, 0, 8388693, 0, 0, 8388694, 0, 0, 8388695, 0, 0, 8388696, 0, 0, 8388697, 0, 0, 8388698, 0, 0, 8388699, 0, 0, 8388700, 0, 0, 8388701, 0, 0, 8388702, 0, 0, 8388703, 0, 0, 8388704, 0, 0, 8388705, 0, 0, 8388706, 0, 0, 8388707, 0, 0, 8388708, 0, 0, 8388709, 0, 0, 8388710, 0, 0, 8388711, 0, 0, 8388712, 0, 0, 8388713, 0, 0, 8388714, 0, 0, 8388715, 0, 0, 8388716, 0, 0, 8388717, 0, 0, 8388718, 0, 0, 8388719, 0, 0, 8388720, 0, 0, 8388721, 0, 0, 8388722, 0, 0, 8388723, 0, 0, 8388724, 0, 0, 8388725, 0, 0, 8388726, 0, 0, 8388727, 0, 0, 8388728, 0, 0, 8388729, 0, 0, 8388730, 0, 0, 8388731, 0, 0, 8388732, 0, 0, 8388733, 0, 0, 8388734, 0, 0, 8388735, 0, 0, 8388736, 0, 0, 8388737, 0, 0, 8388738, 0, 0, 8388739, 0, 0, 8388740, 0, 0, 8388741, 0, 0, 8388742, 0, 0, 8388743, 0, 0, 8388744, 0, 0, 8388745, 0, 0, 8388746, 0, 0, 8388747, 0, 0, 8388748, 0, 0, 8388749, 0, 0, 8388750, 0, 0, 8388751, 0, 0, 8388752, 0, 0, 8388753, 0, 0, 8388754, 0, 0, 8388755, 0, 0, 8388756, 0, 0, 8388757, 0, 0, 8388758, 0, 0, 8388759, 0, 0, 8388760, 0, 0, 8388761, 0, 0, 8388762, 0, 0, 8388763, 0, 0, 8388764, 0, 0, 8388765, 0, 0, 8388766, 0, 0, 8388767, 0, 0, 8388768, 0, 0, 8388769, 0, 0, 8388770, 0, 0, 8388771, 0, 0, 8388772, 0, 0, 8388773, 0, 0, 8388774, 0, 0, 8388775, 0, 0, 8388776, 0, 0, 8388777, 0, 0, 8388778, 0, 0, 8388779, 0, 0, 8388780, 0, 0, 8388781, 0, 0, 8388782, 0, 0, 8388783, 0, 0, 8388784, 0, 0, 8388785, 0, 0, 8388786, 0, 0, 8388787, 0, 0, 8388788, 0, 0, 8388789, 0, 0, 8388790, 0, 0, 8388791, 0, 0, 8388792, 0, 0, 8388793, 0, 0, 8388794, 0, 0, 8388795, 0, 0, 8388796, 0, 0, 8388797, 0, 0, 8388798, 0, 0, 8388799, 0, 0, 8388800, 0, 0 ) + +[node name="Floor" type="TileMap" parent="."] +tile_set = SubResource( 1 ) +cell_size = Vector2( 32, 32 ) +cell_quadrant_size = 32 +collision_layer = 0 +collision_mask = 0 +format = 1 +tile_data = PoolIntArray( 0, 0, 1, 1, 0, 6, 2, 0, 65543, 3, 0, 196610, 4, 0, 196609, 5, 0, 131077, 6, 0, 1, 7, 0, 196614, 8, 0, 196613, 9, 0, 65536, 10, 0, 196612, 11, 0, 6, 65536, 0, 131078, 65537, 0, 65537, 65538, 0, 2, 65539, 0, 2, 65540, 0, 196608, 65541, 0, 196612, 65542, 0, 196610, 65543, 0, 65537, 65544, 0, 7, 65545, 0, 196608, 65546, 0, 196610, 65547, 0, 65541, 131072, 0, 131072, 131073, 0, 196612, 131074, 0, 131072, 131075, 0, 196610, 131076, 0, 131074, 131077, 0, 196611, 131078, 0, 196612, 131079, 0, 131078, 131080, 0, 196613, 131081, 0, 65538, 131082, 0, 3, 131083, 0, 65538, 196608, 0, 131077, 196609, 0, 0, 196610, 0, 65538, 196611, 0, 131079, 196612, 0, 65538, 196613, 0, 196611, 196614, 0, 5, 196615, 0, 65539, 196616, 0, 0, 196617, 0, 2, 196618, 0, 196610, 196619, 0, 196614, 262144, 0, 65538, 262145, 0, 196611, 262146, 0, 196613, 262147, 0, 7, 262148, 0, 1, 262149, 0, 131075, 262150, 0, 65541, 262151, 0, 131074, 262152, 0, 3, 262153, 0, 196609, 262154, 0, 65537, 262155, 0, 3, 327680, 0, 196611, 327681, 0, 196612, 327682, 0, 131077, 327683, 0, 2, 327684, 0, 65539, 327685, 0, 65536, 327686, 0, 196608, 327687, 0, 4, 327688, 0, 65536, 327689, 0, 131075, 327690, 0, 0, 327691, 0, 196611, 393216, 0, 131073, 393217, 0, 3, 393218, 0, 7, 393219, 0, 196608, 393220, 0, 196611, 393221, 0, 1, 393222, 0, 2, 393223, 0, 0, 393224, 0, 65542, 393225, 0, 131075, 393226, 0, 196609, 393227, 0, 65536, 458752, 0, 131072, 458753, 0, 65537, 458754, 0, 131076, 458755, 0, 4, 458756, 0, 196611, 458757, 0, 196609, 458758, 0, 196613, 458759, 0, 196614, 458760, 0, 65542, 458761, 0, 0, 458762, 0, 1, 458763, 0, 65539 ) + [node name="YSort" type="YSort" parent="."] [node name="Player" parent="YSort" instance=ExtResource( 1 )] -position = Vector2( 160, 90 ) +position = Vector2( 192, 128 ) +MAX_SPEED = 200 + +[node name="Camera2D" type="Camera2D" parent="YSort/Player"] +current = true +limit_left = 0 +limit_top = 0 +limit_right = 384 +limit_bottom = 256 +limit_smoothed = true + +[node name="Level Portals" type="YSort" parent="YSort"] + +[node name="Level 1 Portal" parent="YSort/Level Portals" instance=ExtResource( 7 )] +modulate = Color( 0.67451, 0, 0.74902, 1 ) +position = Vector2( 70, 100 ) +level_path = "res://Levels/Level 1.tscn" + +[node name="Level 2 Portal" parent="YSort/Level Portals" instance=ExtResource( 7 )] +modulate = Color( 0.415686, 0.756863, 0, 1 ) +position = Vector2( 120, 70 ) +level_path = "res://Levels/Level 2.tscn" + +[node name="Level 3 Portal" parent="YSort/Level Portals" instance=ExtResource( 7 )] +modulate = Color( 0, 0.415686, 1, 1 ) +position = Vector2( 190, 60 ) +level_path = "res://Levels/Level 3.tscn" + +[node name="Level 4 Portal" parent="YSort/Level Portals" instance=ExtResource( 7 )] +modulate = Color( 1, 0.305882, 0, 1 ) +position = Vector2( 260, 70 ) +level_path = "res://Levels/Level 4.tscn" + +[node name="Level 5 Portal" parent="YSort/Level Portals" instance=ExtResource( 7 )] +modulate = Color( 0.266667, 0, 0.470588, 1 ) +position = Vector2( 310, 100 ) +level_path = "res://Levels/Level 5.tscn" [node name="HUD" parent="." instance=ExtResource( 3 )] [node name="Pause Screen" parent="." instance=ExtResource( 4 )] +disable_back_to_hub = true diff --git a/Levels/Interactables/Level Portal.gd b/Levels/Interactables/Level Portal.gd new file mode 100644 index 0000000..1f6ef04 --- /dev/null +++ b/Levels/Interactables/Level Portal.gd @@ -0,0 +1,11 @@ +extends Area2D + +signal enter_level(level) + +export var level_path: String = 'res://Levels/LEVEL.tscn' + + +func _on_level_portal_body_entered(body: Node) -> void: + if body.is_in_group('player'): + emit_signal('enter_level', level_path) + return diff --git a/Levels/Interactables/Level Portal.tscn b/Levels/Interactables/Level Portal.tscn new file mode 100644 index 0000000..85a80e7 --- /dev/null +++ b/Levels/Interactables/Level Portal.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Sprites/Levels/Interactables/Level_Portal.png" type="Texture" id=1] +[ext_resource path="res://Levels/Interactables/Level Portal.gd" type="Script" id=2] + +[sub_resource type="CapsuleShape2D" id=1] +radius = 8.0 +height = 18.0 + +[node name="Level Portal" type="Area2D"] +light_mask = 0 +collision_layer = 0 +collision_mask = 2 +input_pickable = false +monitorable = false +script = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) +offset = Vector2( 0, -8 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +visible = false +light_mask = 0 +position = Vector2( 0, -8 ) +shape = SubResource( 1 ) + +[connection signal="body_entered" from="." to="." method="_on_level_portal_body_entered"] diff --git a/Main.gd b/Main.gd index 045d744..945f699 100644 --- a/Main.gd +++ b/Main.gd @@ -3,7 +3,7 @@ extends Node export var splash_screen_path: String export var main_menu_path: String export var level_select_menu_path: String -export var world_path: String +export var hub_world_path: String func _ready() -> void: @@ -40,10 +40,13 @@ func play_main_menu() -> Node: func main_menu_option(option: String) -> void: if option == 'new game': - var level_select_menu: Node = play_level_select_menu() - yield(level_select_menu, 'complete') - free_connected_node(level_select_menu, 'level_select_menu_option') - level_select_menu = null + if get_tree().change_scene(hub_world_path) != OK: + print('ERROR: Main failed to change scene to Hub World.') + queue_free() + #var level_select_menu: Node = play_level_select_menu() + #yield(level_select_menu, 'complete') + #free_connected_node(level_select_menu, 'level_select_menu_option') + #level_select_menu = null return diff --git a/Main.tscn b/Main.tscn index 7ca0111..ffcddbe 100644 --- a/Main.tscn +++ b/Main.tscn @@ -8,7 +8,7 @@ script = ExtResource( 1 ) splash_screen_path = "res://GUI/Splash Screen.tscn" main_menu_path = "res://GUI/Main Menu.tscn" level_select_menu_path = "res://GUI/Level Select Menu.tscn" -world_path = "res://Levels/Hub World.tscn" +hub_world_path = "res://Levels/Hub World.tscn" [node name="Background" type="Sprite" parent="."] texture = ExtResource( 3 ) diff --git a/Sprites/Assets/Black_Tile.png b/Sprites/Assets/Black_Tile.png new file mode 100644 index 0000000..2206a52 Binary files /dev/null and b/Sprites/Assets/Black_Tile.png differ diff --git a/Sprites/Assets/Black_Tile.png.import b/Sprites/Assets/Black_Tile.png.import new file mode 100644 index 0000000..24dbfde --- /dev/null +++ b/Sprites/Assets/Black_Tile.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Black_Tile.png-468b234ed74eefbb74c33d4d44fd3553.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Assets/Black_Tile.png" +dest_files=[ "res://.import/Black_Tile.png-468b234ed74eefbb74c33d4d44fd3553.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=0 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Sprites/Levels/Interactables/Level_Portal.png b/Sprites/Levels/Interactables/Level_Portal.png new file mode 100644 index 0000000..f0718bb Binary files /dev/null and b/Sprites/Levels/Interactables/Level_Portal.png differ diff --git a/Sprites/Levels/Interactables/Level_Portal.png.import b/Sprites/Levels/Interactables/Level_Portal.png.import new file mode 100644 index 0000000..fe114a1 --- /dev/null +++ b/Sprites/Levels/Interactables/Level_Portal.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Level_Portal.png-032cf024355e4d24a270165e6487b474.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Levels/Interactables/Level_Portal.png" +dest_files=[ "res://.import/Level_Portal.png-032cf024355e4d24a270165e6487b474.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=0 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png b/Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png new file mode 100644 index 0000000..02c63e6 Binary files /dev/null and b/Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png differ diff --git a/Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png.import b/Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png.import new file mode 100644 index 0000000..82cf097 --- /dev/null +++ b/Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Hub_World_Grass_Atlas.png-35f62295b86dd25eba082844cf2760f1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png" +dest_files=[ "res://.import/Hub_World_Grass_Atlas.png-35f62295b86dd25eba082844cf2760f1.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=0 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png new file mode 100644 index 0000000..561c226 Binary files /dev/null and b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png differ diff --git a/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png.import b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png.import new file mode 100644 index 0000000..964f7dd --- /dev/null +++ b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Back_To_Hub_Button_Hover.png-7168f4a8f8f34c936a30024ee0a830de.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Hover.png" +dest_files=[ "res://.import/Back_To_Hub_Button_Hover.png-7168f4a8f8f34c936a30024ee0a830de.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=0 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png new file mode 100644 index 0000000..5a1629a Binary files /dev/null and b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png differ diff --git a/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png.import b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png.import new file mode 100644 index 0000000..b5eb706 --- /dev/null +++ b/Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Back_To_Hub_Button_Normal.png-f0f1f9eb9ea13789e27688857590fc22.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/Menus/Menu Buttons/Back_To_Hub_Button_Normal.png" +dest_files=[ "res://.import/Back_To_Hub_Button_Normal.png-f0f1f9eb9ea13789e27688857590fc22.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=0 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0