Updated Hub World to have portals to levels and disabled the level select menu
This commit is contained in:
18 files changed
+389
-15
No files matched your search
+13
-2
@@ -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
|
||||
+111
-2
@@ -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, 49Line truncated
|
||||
|
||||
[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
|
||||
@@ -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
|
||||
@@ -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"]
|
||||
Reference in new issue
Block a user