From 718a0273e8c48d9af0bafafd74d4d05e9faa8b4c Mon Sep 17 00:00:00 2001 From: "Telmo \"Trooper" Date: Thu, 26 May 2022 23:02:14 -0300 Subject: [PATCH] chore/floating-platform (#62) * Renamed 'ui_sprint' to 'sprint' * Added Godot PowerUp to static floating platform * Renamed a few nodes in test_map; Made floating platform not cast lights. Co-authored-by: Telmo Valverde --- entities/player/player.gd | 4 ++-- maps/test_map.tscn | 37 ++++++++++++++++++++++++++++++------- project.godot | 2 +- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/entities/player/player.gd b/entities/player/player.gd index 4db91f03..d835301b 100644 --- a/entities/player/player.gd +++ b/entities/player/player.gd @@ -48,7 +48,7 @@ func _physics_process(delta): $CollisionShape.global_transform.origin.z = $Pivot.global_transform.origin.z $CollisionShape.rotation.y = $Pivot.rotation.y - if Input.is_action_pressed("ui_sprint"): # Running. + if Input.is_action_pressed("sprint"): # Running. speed = 22 $AnimationPlayer.playback_speed = 3.0 else: # Walking. @@ -62,7 +62,7 @@ func _physics_process(delta): if is_on_floor(): dash_available = true - if dash_available and !is_on_floor() and Input.is_action_just_pressed("ui_sprint"): + if dash_available and !is_on_floor() and Input.is_action_just_pressed("sprint"): if $DashDurationTimer.is_stopped(): is_dashing = true dash_available = false diff --git a/maps/test_map.tscn b/maps/test_map.tscn index 6001fefa..360ba925 100644 --- a/maps/test_map.tscn +++ b/maps/test_map.tscn @@ -115,18 +115,18 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -25.6379, 1.85172, -27.0031 ) [node name="Map" type="Spatial" parent="."] -[node name="Platform1" type="StaticBody" parent="Map"] +[node name="GreenPlatform" type="StaticBody" parent="Map"] collision_layer = 4 collision_mask = 0 -[node name="CollisionShape" type="CollisionShape" parent="Map/Platform1"] +[node name="CollisionShape" type="CollisionShape" parent="Map/GreenPlatform"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.952113, 0 ) shape = SubResource( 3 ) __meta__ = { "_edit_group_": true } -[node name="MeshInstance" type="MeshInstance" parent="Map/Platform1"] +[node name="MeshInstance" type="MeshInstance" parent="Map/GreenPlatform"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 ) mesh = SubResource( 4 ) material/0 = ExtResource( 9 ) @@ -152,19 +152,19 @@ __meta__ = { "_edit_group_": true } -[node name="Platform2" type="StaticBody" parent="Map"] +[node name="BluePlatform" type="StaticBody" parent="Map"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -110.626 ) collision_layer = 4 collision_mask = 0 -[node name="CollisionShape" type="CollisionShape" parent="Map/Platform2"] +[node name="CollisionShape" type="CollisionShape" parent="Map/BluePlatform"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.01119, 0 ) shape = SubResource( 3 ) __meta__ = { "_edit_group_": true } -[node name="MeshInstance" type="MeshInstance" parent="Map/Platform2"] +[node name="MeshInstance" type="MeshInstance" parent="Map/BluePlatform"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 1.35706 ) mesh = SubResource( 4 ) material/0 = ExtResource( 8 ) @@ -172,6 +172,30 @@ __meta__ = { "_edit_group_": true } +[node name="FloatingBluePlatform" type="StaticBody" parent="Map"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 62.8, 49.2458, -75.826 ) +collision_layer = 4 +collision_mask = 0 + +[node name="CollisionShape" type="CollisionShape" parent="Map/FloatingBluePlatform"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.01119, 0 ) +shape = SubResource( 3 ) +__meta__ = { +"_edit_group_": true +} + +[node name="MeshInstance" type="MeshInstance" parent="Map/FloatingBluePlatform"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 1.35706 ) +cast_shadow = 0 +mesh = SubResource( 4 ) +material/0 = ExtResource( 8 ) +__meta__ = { +"_edit_group_": true +} + +[node name="GodotPowerUp2" parent="Map/FloatingBluePlatform" instance=ExtResource( 15 )] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 5, -12.2606 ) + [node name="SmallPlatform" type="StaticBody" parent="Map"] transform = Transform( 0.0996611, 0, 0, 0, 1, 0, 0, 0, -0.225957, 23.1125, 0.291998, -44.0602 ) collision_layer = 4 @@ -247,7 +271,6 @@ transform = Transform( 1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0 shadow_enabled = true [node name="Player" parent="." groups=["players"] instance=ExtResource( 14 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.127, 0.835 ) collision_mask = 524302 [node name="CameraPivot" type="Spatial" parent="."] diff --git a/project.godot b/project.godot index 63f96b89..bf06c62f 100644 --- a/project.godot +++ b/project.godot @@ -107,7 +107,7 @@ ui_fast_forward={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } -ui_sprint={ +sprint={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ]