From 672fc5177d32c9fbb44586a86fd528bba0fab22c Mon Sep 17 00:00:00 2001 From: "Telmo \"Trooper" Date: Sun, 22 May 2022 20:17:32 -0300 Subject: [PATCH] feat/base-portal (#52) * Added portal placeholder in test_map * Made a scene for PortalPlaceholder * Added back-portal to mountain map * Chose a position for the portal back Co-authored-by: Telmo Valverde --- maps/mountain_map.tscn | 25 +++++++++++++++++++++++- maps/portal_placeholder.gd | 6 ++++++ maps/portal_placeholder.tscn | 25 ++++++++++++++++++++++++ maps/test_map.tscn | 13 ++++++++---- models/height_map/Material.material | Bin 0 -> 746 bytes models/height_map/height_map.glb.import | 2 +- 6 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 maps/portal_placeholder.gd create mode 100644 maps/portal_placeholder.tscn create mode 100644 models/height_map/Material.material 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 0000000000000000000000000000000000000000..945bee183ed1695f1bacce81251123ba99ed447f GIT binary patch literal 746 zcmV~8@e)B*s27>7kERRB}~Rsi{(8WAj| zVt{aQgcCM?>5s!+W#e*%{pSqsVrCTPj_Y2M%FGVf#%r_oy3VAs(?PYsQYG@^zeU7* ziTYvBHnR#d(_o9*`PgAmA6JH%H5g!K0?Y!6&CAHlD3~ug&FUUyH>1mbT;;1&#lg!} z&^5V+Cd$5Nb(|`g!nE^plKkV8%AzBsM3)I`RJcp~FKu%qKd9d;lFSs>lTPshv*SoZT~rofur75QPa7A-8o%_Oi~ zM1CvNgQJm^T~(S-8o5-u5$q&k_dyd$Nw zTude*E=Z6V5r9Am=fY#5bJ;w6ACC;47R(I5FKy&zRv?kWcTJgaxs6vxCEN=Ffk0MQ zeEPC*E(VQ9@iRTbUa~v?mwsG%oDpm+?q^r!;E_>dE^@R3fQP8DDI!!NBO^(Y6oxTS z0wIOUiU$&)6g|iit)h{*(*C~z1_VxqL9Cd6%p-$>wt@Ppn0A%%FG1q%cDlyJxwqBv zb1&S%)y}cxEo1YcJ8!g#J0hZ55e5X~I})DZM@+uZt)`_OkzyPanW3lQAceggIAM8H zW#LJ-g~i4PpBscNQFgFBV~GM14ewho&vP`-HxXy25az;T4`~C_3z$5))Am_JTEI)h z&Zt4p&CPp52t_`?z!fCA#4GH&PYewB@TV3{q1=L)9o^@&Et; literal 0 HcmV?d00001 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