Skip to content

Commit

Permalink
chore/floating-platform (#62)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
telmotrooper and telmotrooper authored May 27, 2022
1 parent fa91551 commit 718a027
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
4 changes: 2 additions & 2 deletions entities/player/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
37 changes: 30 additions & 7 deletions maps/test_map.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -152,26 +152,50 @@ __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 )
__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
Expand Down Expand Up @@ -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="."]
Expand Down
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]
Expand Down

0 comments on commit 718a027

Please sign in to comment.