@@ -34,7 +34,13 @@ In this scenario, you want the user to press the four directional keys (up/left/
3434or W/A/S/D) and move in the selected direction. The name "8-way movement" comes from the
3535fact that the player can move diagonally by pressing two keys at the same time.
3636
37- .. image :: img/movement_8way.gif
37+ .. video :: video/movement_8way.webm
38+ :alt: 8-way movement
39+ :autoplay:
40+ :loop:
41+ :muted:
42+ :align: default
43+ :width: 100%
3844
3945Add a script to the character body and add the following code:
4046
@@ -98,7 +104,13 @@ This type of movement is sometimes called "Asteroids-style" because it resembles
98104how that classic arcade game worked. Pressing left/right rotates the character,
99105while up/down moves it forward or backward in whatever direction it's facing.
100106
101- .. image :: img/movement_rotate1.gif
107+ .. video :: video/movement_rotate_keyboard.webm
108+ :alt: Rotation + movement
109+ :autoplay:
110+ :loop:
111+ :muted:
112+ :align: default
113+ :width: 100%
102114
103115.. tabs ::
104116 .. code-tab :: gdscript GDScript
@@ -160,7 +172,13 @@ This style of movement is a variation of the previous one. This time, the direct
160172is set by the mouse position instead of the keyboard. The character will always
161173"look at" the mouse pointer. The forward/back inputs remain the same, however.
162174
163- .. image :: img/movement_rotate2.gif
175+ .. video :: video/movement_rotate_mouse.webm
176+ :alt: Rotation + movement (mouse)
177+ :autoplay:
178+ :loop:
179+ :muted:
180+ :align: default
181+ :width: 100%
164182
165183.. tabs ::
166184 .. code-tab :: gdscript GDScript
@@ -219,7 +237,13 @@ Click-and-move
219237This last example uses only the mouse to control the character. Clicking
220238on the screen will cause the player to move to the target location.
221239
222- .. image :: img/movement_click.gif
240+ .. video :: video/movement_click.webm
241+ :alt: Click-and-move
242+ :autoplay:
243+ :loop:
244+ :muted:
245+ :align: default
246+ :width: 100%
223247
224248.. tabs ::
225249 .. code-tab :: gdscript GDScript
0 commit comments