Skip to content

Commit 97e0466

Browse files
committed
A couple of comments and replaced words (referenced return statement instead of pass statement in readme) clarified. New Icon.
1 parent 7de0cdc commit 97e0466

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

Game.tscn

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[gd_scene load_steps=10 format=2]
22

3-
[ext_resource path="res://src/Player/Player.tscn" type="PackedScene" id=2]
3+
[ext_resource path="res://src/Player/Player.tscn" type="PackedScene" id=1]
44

55
[sub_resource type="SpatialMaterial" id=1]
66
albedo_color = Color( 1, 0.537255, 0.8, 1 )
@@ -31,17 +31,21 @@ points = PoolVector3Array( -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1,
3131
[node name="TestMap" type="Spatial" parent="."]
3232

3333
[node name="Ground" type="MeshInstance" parent="TestMap"]
34+
editor/display_folded = true
3435
mesh = SubResource( 2 )
3536
material/0 = null
3637

3738
[node name="StaticBody" type="StaticBody" parent="TestMap/Ground"]
39+
editor/display_folded = true
3840

3941
[node name="CollisionShape" type="CollisionShape" parent="TestMap/Ground/StaticBody"]
4042
shape = SubResource( 3 )
4143

4244
[node name="Obstacles" type="Spatial" parent="TestMap"]
45+
editor/display_folded = true
4346

4447
[node name="MeshInstance" type="MeshInstance" parent="TestMap/Obstacles"]
48+
editor/display_folded = true
4549
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -7, 0, -8 )
4650
mesh = SubResource( 4 )
4751
material/0 = SubResource( 5 )
@@ -52,6 +56,7 @@ material/0 = SubResource( 5 )
5256
shape = SubResource( 6 )
5357

5458
[node name="MeshInstance4" type="MeshInstance" parent="TestMap/Obstacles"]
59+
editor/display_folded = true
5560
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 0, -9 )
5661
mesh = SubResource( 4 )
5762
material/0 = SubResource( 5 )
@@ -62,6 +67,7 @@ material/0 = SubResource( 5 )
6267
shape = SubResource( 6 )
6368

6469
[node name="MeshInstance5" type="MeshInstance" parent="TestMap/Obstacles"]
70+
editor/display_folded = true
6571
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, -2 )
6672
mesh = SubResource( 4 )
6773
material/0 = SubResource( 5 )
@@ -72,6 +78,7 @@ material/0 = SubResource( 5 )
7278
shape = SubResource( 6 )
7379

7480
[node name="MeshInstance6" type="MeshInstance" parent="TestMap/Obstacles"]
81+
editor/display_folded = true
7582
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 1, -2 )
7683
mesh = SubResource( 4 )
7784
material/0 = SubResource( 5 )
@@ -82,6 +89,7 @@ material/0 = SubResource( 5 )
8289
shape = SubResource( 6 )
8390

8491
[node name="MeshInstance7" type="MeshInstance" parent="TestMap/Obstacles"]
92+
editor/display_folded = true
8593
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 1, -4 )
8694
mesh = SubResource( 4 )
8795
material/0 = SubResource( 5 )
@@ -92,6 +100,7 @@ material/0 = SubResource( 5 )
92100
shape = SubResource( 6 )
93101

94102
[node name="MeshInstance8" type="MeshInstance" parent="TestMap/Obstacles"]
103+
editor/display_folded = true
95104
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 2, -6 )
96105
mesh = SubResource( 4 )
97106
material/0 = SubResource( 5 )
@@ -102,6 +111,7 @@ material/0 = SubResource( 5 )
102111
shape = SubResource( 6 )
103112

104113
[node name="MeshInstance9" type="MeshInstance" parent="TestMap/Obstacles"]
114+
editor/display_folded = true
105115
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 3.99933, -6 )
106116
mesh = SubResource( 4 )
107117
material/0 = SubResource( 5 )
@@ -112,6 +122,7 @@ material/0 = SubResource( 5 )
112122
shape = SubResource( 6 )
113123

114124
[node name="MeshInstance10" type="MeshInstance" parent="TestMap/Obstacles"]
125+
editor/display_folded = true
115126
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 11.8311, -6 )
116127
mesh = SubResource( 4 )
117128
material/0 = SubResource( 5 )
@@ -122,6 +133,7 @@ material/0 = SubResource( 5 )
122133
shape = SubResource( 6 )
123134

124135
[node name="MeshInstance11" type="MeshInstance" parent="TestMap/Obstacles"]
136+
editor/display_folded = true
125137
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.9415, 8.03339, -6 )
126138
mesh = SubResource( 4 )
127139
material/0 = SubResource( 5 )
@@ -132,6 +144,7 @@ material/0 = SubResource( 5 )
132144
shape = SubResource( 6 )
133145

134146
[node name="MeshInstance2" type="MeshInstance" parent="TestMap/Obstacles"]
147+
editor/display_folded = true
135148
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 1, -2 )
136149
mesh = SubResource( 4 )
137150
material/0 = SubResource( 5 )
@@ -142,6 +155,7 @@ material/0 = SubResource( 5 )
142155
shape = SubResource( 7 )
143156

144157
[node name="MeshInstance3" type="MeshInstance" parent="TestMap/Obstacles"]
158+
editor/display_folded = true
145159
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 1, -11 )
146160
mesh = SubResource( 4 )
147161
material/0 = SubResource( 5 )
@@ -155,4 +169,4 @@ shape = SubResource( 8 )
155169
transform = Transform( 0.766044, 0.166366, -0.620885, 0.271654, 0.791635, 0.547283, 0.582563, -0.587909, 0.561234, 0, 12, 0 )
156170
shadow_enabled = true
157171

158-
[node name="Player" parent="." instance=ExtResource( 2 )]
172+
[node name="Player" parent="." instance=ExtResource( 1 )]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ In addition, the Aim state allows some finer-tuned changes, like whether the aim
5858

5959
While the scenes can be modified extensively with new nodes and raw code, the state machine model allow for some simple, new functionality with relative ease.
6060

61-
As an example, there is the `Extensions` folder which contains additional player states for using the aiming view to fire a hookshot that pulls you towards the reticle. Once those states have been added to the Player's `Move` state, you only need to replace the `pass` in Move's `enter` with code like `owner.camera.connect("aim_fired", self, "on_Camera_aim_fired")` and Move's `exit` with code like `owner.camera.disconnect("aim_fired", self, "on_Camera_aim_fired")`
61+
As an example, there is the `Extensions` folder which contains additional player states for using the aiming view to fire a hookshot that pulls you towards the reticle. Once those states have been added to the Player's `Move` state, you only need to replace the return statement in Move's `enter` with code like `owner.camera.connect("aim_fired", self, "on_Camera_aim_fired")` and Move's `exit` with code like `owner.camera.disconnect("aim_fired", self, "on_Camera_aim_fired")`
6262

6363
# Credits #
6464

icon.png

2.48 KB
Loading

src/Player/MoveStates/Move.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ func exit() -> void:
5151

5252

5353
"""Callback to transition to the optional Zip state
54-
It only works if the Zip state node exists"""
54+
It only works if the Zip state node exists.
55+
It is intended to work via signals"""
5556
func _on_Camera_aim_fired(target_vector: Vector3) -> void:
5657
_state_machine.transition_to("Move/Zip", { zip_target = target_vector })
5758

src/Player/Player.tscn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ height = 1.5239
1717
script = ExtResource( 1 )
1818

1919
[node name="PlayerMesh" parent="." instance=ExtResource( 2 )]
20-
transform = Transform( -1, 0, -1.50996e-07, 0, 1, 0, 1.50996e-07, 0, -1, 0, 0, 0 )
20+
transform = Transform( -1, 0, -1.50996e-007, 0, 1, 0, 1.50996e-007, 0, -1, 0, 0, 0 )
2121

2222
[node name="CollisionShape" type="CollisionShape" parent="."]
23-
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1, 0 )
23+
transform = Transform( 1, 0, 0, 0, -4.37114e-008, -1, 0, 1, -4.37114e-008, 0, 1, 0 )
2424
shape = SubResource( 1 )
2525

2626
[node name="StateMachine" type="Node" parent="."]

0 commit comments

Comments
 (0)