diff --git a/maps/mountain_map.tscn b/maps/mountain_map.tscn index eb438165..2a6d1fe8 100644 --- a/maps/mountain_map.tscn +++ b/maps/mountain_map.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=2] +[gd_scene load_steps=19 format=2] [ext_resource path="res://models/height_map/height_map.tscn" type="PackedScene" id=1] [ext_resource path="res://shaders/stylized_water/stylized_water_material.tres" type="Material" id=2] @@ -11,6 +11,8 @@ [ext_resource path="res://entities/enemy/blue_enemy.tscn" type="PackedScene" id=9] [ext_resource path="res://models/ball/ball.tscn" type="PackedScene" id=10] [ext_resource path="res://models/red_button/red_button.tscn" type="PackedScene" id=11] +[ext_resource path="res://maps/portal_placeholder.tscn" type="PackedScene" id=12] +[ext_resource path="res://models/height_map/Material.material" type="Material" id=13] [sub_resource type="Curve3D" id=1] _data = { @@ -70,6 +72,10 @@ tracks/1/keys = { } ] } +[sub_resource type="CylinderShape" id=5] +radius = 5.0 +height = 5.0 + [node name="MontainMap" type="Spatial"] script = ExtResource( 3 ) drain_water_sound = ExtResource( 4 ) @@ -126,5 +132,22 @@ far = 200.0 [node name="Boundary" parent="." instance=ExtResource( 5 )] transform = Transform( 15, 0, 0, 0, -0.2, -2.26494e-06, 0, 3.01992e-08, -15, 65, -60, 91 ) +[node name="CSGCylinder" type="CSGCylinder" parent="."] +transform = Transform( -0.5, 0, -0.866025, 0, 1, 0, 0.866025, 0, -0.5, 55.2639, 3.8, 21.8429 ) +radius = 5.0 +height = 5.0 +material = ExtResource( 13 ) + +[node name="PortalPlaceholder" parent="CSGCylinder" instance=ExtResource( 12 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.52588e-05, 2.5, -0.00272942 ) +map_name = "test_map" + +[node name="StaticBody" type="StaticBody" parent="CSGCylinder"] +collision_layer = 4 +collision_mask = 0 + +[node name="CollisionShape" type="CollisionShape" parent="CSGCylinder/StaticBody"] +shape = SubResource( 5 ) + [connection signal="hit" from="Player" to="." method="_on_Player_hit"] [connection signal="pressed" from="Props/RedButton" to="." method="_on_RedButton_pressed"] diff --git a/maps/portal_placeholder.gd b/maps/portal_placeholder.gd new file mode 100644 index 00000000..21c3da3a --- /dev/null +++ b/maps/portal_placeholder.gd @@ -0,0 +1,6 @@ +extends CSGCylinder + +export var map_name: String + +func _on_Portal_entered(_body): + GameState.change_map(map_name) diff --git a/maps/portal_placeholder.tscn b/maps/portal_placeholder.tscn new file mode 100644 index 00000000..1470893b --- /dev/null +++ b/maps/portal_placeholder.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://maps/portal_placeholder.gd" type="Script" id=1] + +[sub_resource type="SpatialMaterial" id=19] +albedo_color = Color( 0.639216, 0.141176, 0.141176, 1 ) + +[sub_resource type="CylinderShape" id=20] + +[node name="PortalPlaceholder" type="CSGCylinder"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0670445, 0, -135.074 ) +radius = 3.0 +height = 0.5 +material = SubResource( 19 ) +script = ExtResource( 1 ) + +[node name="Area" type="Area" parent="."] +collision_layer = 0 +monitorable = false + +[node name="CollisionShape" type="CollisionShape" parent="Area"] +transform = Transform( 3, 0, 0, 0, 0.25, 0, 0, 0, 3, 0, 0, 0 ) +shape = SubResource( 20 ) + +[connection signal="body_entered" from="Area" to="." method="_on_Portal_entered"] diff --git a/maps/test_map.tscn b/maps/test_map.tscn index f2a0efb1..c5808a65 100644 --- a/maps/test_map.tscn +++ b/maps/test_map.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=36 format=2] +[gd_scene load_steps=37 format=2] [ext_resource path="res://addons/scatter/demos/assets/grass/data/m_grass_52.tres" type="Material" id=1] [ext_resource path="res://addons/scatter/src/core/scatter.gd" type="Script" id=2] @@ -20,6 +20,7 @@ [ext_resource path="res://models/goweti/goweti.tscn" type="PackedScene" id=18] [ext_resource path="res://models/red_button/red_button.tscn" type="PackedScene" id=19] [ext_resource path="res://entities/enemy/purple_enemy.tscn" type="PackedScene" id=20] +[ext_resource path="res://maps/portal_placeholder.tscn" type="PackedScene" id=21] [sub_resource type="BoxShape" id=3] extents = Vector3( 30, 1, 30 ) @@ -316,6 +317,10 @@ direction = 1 [node name="Goweti" parent="." instance=ExtResource( 18 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 60.906, -0.312, -0.581 ) +[node name="PortalPlaceholder" parent="." instance=ExtResource( 21 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0670445, 0.244789, -135.074 ) +map_name = "mountain_map" + [node name="Enemies" type="Spatial" parent="."] [node name="BlueEnemyPath" type="Path" parent="Enemies"] @@ -358,14 +363,14 @@ transform = Transform( 0.854641, 0, -0.519218, 0, 1, 0, 0.519218, 0, 0.854641, 2 [node name="BlueEnemy4" parent="Enemies/BlueEnemyPath4/PathFollow" instance=ExtResource( 10 )] transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0 ) -[node name="BlueEnemyPath5" type="Path" parent="Enemies"] +[node name="PurpleEnemyPath" type="Path" parent="Enemies"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.04762, 0, -119.803 ) curve = SubResource( 18 ) -[node name="PathFollow" type="PathFollow" parent="Enemies/BlueEnemyPath5"] +[node name="PathFollow" type="PathFollow" parent="Enemies/PurpleEnemyPath"] transform = Transform( -0.192319, 0, 0.981332, 0, 1, 0, -0.981332, 0, -0.192319, -21.9524, 0, 7.80272 ) -[node name="PurpleEnemy" parent="Enemies/BlueEnemyPath5/PathFollow" instance=ExtResource( 20 )] +[node name="PurpleEnemy" parent="Enemies/PurpleEnemyPath/PathFollow" instance=ExtResource( 20 )] transform = Transform( -6, 0, 5.24537e-07, 0, 6, 0, -5.24537e-07, 0, -6, 0, 0, 0 ) patrolling_speed = 18 diff --git a/models/height_map/Material.material b/models/height_map/Material.material new file mode 100644 index 00000000..945bee18 Binary files /dev/null and b/models/height_map/Material.material differ diff --git a/models/height_map/height_map.glb.import b/models/height_map/height_map.glb.import index 2d5401fe..54453a98 100644 --- a/models/height_map/height_map.glb.import +++ b/models/height_map/height_map.glb.import @@ -18,7 +18,7 @@ nodes/custom_script="" nodes/storage=0 nodes/use_legacy_names=false materials/location=1 -materials/storage=0 +materials/storage=1 materials/keep_on_reimport=true meshes/octahedral_compression=true meshes/compress=4286