Commit 7fb6989
committed
player: Add "glide" special ability
If the player holds down the "jump" action, their character's downwards
speed is capped to a constant. This allows the player-character to
travel across wider gaps by jumping then gliding.
The function call for this ability is in _physics_process(), after other
"normal" adjustments to the velocity but before move_and_slide().
However, it is commented out. A learner must find this commented-out
line and uncomment it to enable this ability.
The sound effect is from
https://freesound.org/people/tothrec2/sounds/596541/, licensed under
CC0-1.0.1 parent 242bead commit 7fb6989
File tree
4 files changed
+49
-1
lines changed- assets/sounds
- components/player
- scripts
4 files changed
+49
-1
lines changedBinary file not shown.
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
109 | 131 | | |
110 | 132 | | |
111 | 133 | | |
| |||
142 | 164 | | |
143 | 165 | | |
144 | 166 | | |
| 167 | + | |
| 168 | + | |
145 | 169 | | |
146 | 170 | | |
147 | 171 | | |
| |||
0 commit comments