Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Arcade [PyPi Release History](https://pypi.org/project/arcade/#history) page.
- Sped up removing many sprites from a large `SpriteList`, such as every bullet that hit something this frame. `SpriteList.remove()`, and so `Sprite.remove_from_sprite_lists()` and `kill()`, used to search the whole list for each sprite. Removals now wait until the list is next used, and many are applied in one pass: removing 100 sprites from 41,000 went from 19 ms to 3.3 ms, and 500 from 166,000 went from 630 ms to 17 ms. Drawing order is kept, and a few removals cost the same as before.
- Documented choosing a spatial hash cell size (`spatial_hash_cell_size`) in the performance tips and the `SpriteList` docs: about the size of the sprites in the list. With 4 pixel sprites, collision checks were 16 times faster with 8 pixel cells than with the default of 128.
- Type checking with mypy and pyright now fails the CI check, like formatting and linting. Their existing errors are fixed.
- Fixed code excerpts in the docs that highlighted or showed the wrong lines, because the example code had changed since their line numbers were set. This covers 62 excerpts: 48 in the platformer, pymunk platformer, menu, card game, compute shader, raycasting and shader toy glow tutorials, and 14 on example pages. Most now highlight the same code they were written for. Where the code was rewritten, they highlight the code that does the same job now.

## 4.0.0.dev8

Expand Down
2 changes: 1 addition & 1 deletion doc/example_code/camera2d_splitscreen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Two Player Split Screen
.. literalinclude:: ../../arcade/examples/camera2d_splitscreen.py
:caption: camera2d_splitscreen.py
:linenos:
:emphasize-lines: 145-149, 206-228, 251-253, 256-260, 263-292
:emphasize-lines: 144-150, 217-239, 245-248, 254-264, 269-271, 273-303, 305-314
2 changes: 1 addition & 1 deletion doc/example_code/performance_statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ See :ref:`perf_info_api` for more information about the performance api.
.. literalinclude:: ../../arcade/examples/performance_statistics.py
:caption: performance_statistics.py
:linenos:
:emphasize-lines: 43-45, 114-141, 152-157, 164-166
:emphasize-lines: 42-44, 120-147, 158-164, 171-173
2 changes: 1 addition & 1 deletion doc/example_code/sprite_bullets_periodic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ to this example.
.. literalinclude:: ../../arcade/examples/sprite_bullets_periodic.py
:caption: sprite_bullets_periodic.py
:linenos:
:emphasize-lines: 14-48, 76-79, 86-89, 107-108
:emphasize-lines: 14-48, 79-84, 91-94, 112-113
2 changes: 1 addition & 1 deletion doc/example_code/sprite_collect_coins_background.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Using a Background Image
.. literalinclude:: ../../arcade/examples/sprite_collect_coins_background.py
:caption: sprite_collect_coins_background.py
:linenos:
:emphasize-lines: 41-42, 62-65, 99-102
:emphasize-lines: 33-34, 84-88
2 changes: 1 addition & 1 deletion doc/example_code/sprite_explosion_bitmapped.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Sprite Explosions Bitmapped
.. literalinclude:: ../../arcade/examples/sprite_explosion_bitmapped.py
:caption: sprite_explosion_bitmapped.py
:linenos:
:emphasize-lines: 26, 29-47, 62, 71-87, 99, 140, 181, 192-203
:emphasize-lines: 26, 29-49, 64, 82-104, 115, 145, 195, 206-217
2 changes: 1 addition & 1 deletion doc/example_code/sprite_face_left_or_right.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Sprite: Face Left or Right
.. literalinclude:: ../../arcade/examples/sprite_face_left_or_right.py
:caption: sprite_face_left_or_right.py
:linenos:
:emphasize-lines: 23-25, 33-45, 51-55
:emphasize-lines: 23-25, 30-32, 38-42, 67-69, 78
2 changes: 1 addition & 1 deletion doc/example_code/sprite_move_keyboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Move By Keyboard
.. literalinclude:: ../../arcade/examples/sprite_move_keyboard.py
:caption: sprite_move_keyboard.py
:linenos:
:emphasize-lines: 25-44, 96-97, 99-110, 112-122
:emphasize-lines: 25-44, 98-99, 101-112, 114-124
2 changes: 1 addition & 1 deletion doc/example_code/sprite_move_keyboard_accel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Acceleration and Friction
.. literalinclude:: ../../arcade/examples/sprite_move_keyboard_accel.py
:caption: sprite_move_keyboard_accel.py
:linenos:
:emphasize-lines: 24-31, 43, 46, 50, 53, 128-160
:emphasize-lines: 24-31, 43, 46, 50, 53, 132-164
2 changes: 1 addition & 1 deletion doc/example_code/sprite_move_keyboard_better.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ See the highlighted sections.
.. literalinclude:: ../../arcade/examples/sprite_move_keyboard_better.py
:caption: sprite_move_keyboard_better.py
:linenos:
:emphasize-lines: 65-69, 96-109, 119-133, 135-149
:emphasize-lines: 65-69, 98-111, 121-135, 137-151
2 changes: 1 addition & 1 deletion doc/example_code/sprite_move_scrolling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ See also :ref:`sprite_move_scrolling_box`.
.. literalinclude:: ../../arcade/examples/sprite_move_scrolling.py
:caption: sprite_move_scrolling.py
:linenos:
:emphasize-lines: 56-59, 96-97, 103-104, 160-161, 163-174, 176-182
:emphasize-lines: 55-58, 100-101, 107-108, 161-162, 164-176, 178-184
2 changes: 1 addition & 1 deletion doc/example_code/sprite_move_scrolling_shake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ See the highlighted lines below.
.. literalinclude:: ../../arcade/examples/sprite_move_scrolling_shake.py
:caption: sprite_move_scrolling_shake.py
:linenos:
:emphasize-lines: 154-171
:emphasize-lines: 58-64, 122, 130-131, 159, 170
2 changes: 1 addition & 1 deletion doc/example_code/sprite_no_coins_on_walls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Randomly Place Coins, But Away From Walls And Other Coins
.. literalinclude:: ../../arcade/examples/sprite_no_coins_on_walls.py
:caption: sprite_no_coins_on_walls.py
:linenos:
:emphasize-lines: 83-107
:emphasize-lines: 85-109
2 changes: 1 addition & 1 deletion doc/example_code/sprite_rotate_around_point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ with user input, see :ref:`sprite_rotate_around_tank`.
.. literalinclude:: ../../arcade/examples/sprite_rotate_around_point.py
:caption: sprite_rotate_around_point.py
:linenos:
:emphasize-lines: 30-48, 91-98
:emphasize-lines: 29-52, 97-106
2 changes: 1 addition & 1 deletion doc/example_code/sprite_rotate_around_tank.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ See the docstring, comments, and on screen instructions for further info.
.. literalinclude:: ../../arcade/examples/sprite_rotate_around_tank.py
:caption: sprite_rotation_around_tank.py
:linenos:
:emphasize-lines: 58-72, 135-160
:emphasize-lines: 60-75, 143-167
2 changes: 1 addition & 1 deletion doc/tutorials/card_game/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ it over:
:caption: Flip Up Cards
:linenos:
:pyobject: MyGame.on_mouse_press
:emphasize-lines: 15-18
:emphasize-lines: 17-20

Test
~~~~
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorials/compute_shader/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ docstrings & comments explain why in greater detail:
.. literalinclude:: main.py
:language: python
:caption: Generating Well-Aligned Data to Load onto the GPU
:lines: 25-70
:lines: 25-72

Allocating the Buffers
^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: main.py
:language: python
:caption: Allocating the Buffers & Loading the Data onto the GPU
:lines: 88-116
:lines: 90-118


Visualization Shaders
Expand Down
24 changes: 12 additions & 12 deletions doc/tutorials/menu/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ later why are those parameters needed.

.. literalinclude:: menu_05.py
:caption: Editing parameters
:lines: 161-168
:lines: 187-194

We also need to change accordingly the places where we have used this class i.e
options and volume ``on_click`` event listener. The layer parameter being set
1, means that this layer is always drawn on top i.e.its the first layer.

.. literalinclude:: menu_05.py
:caption: Editing arguments
:lines: 115-136
:lines: 115-162

Now you might be getting a little idea why we have edited the parameters but
follow on to actually know the reason.
Expand All @@ -227,13 +227,13 @@ background color so it appears invisible.

.. literalinclude:: menu_05.py
:caption: Adding title label
:lines: 193-195
:lines: 219-221

Adding it to the widget layout.

.. literalinclude:: menu_05.py
:caption: Adding title label to the layout
:lines: 238-239
:lines: 269-270


Adding an Input Field
Expand All @@ -246,13 +246,13 @@ the title label.

.. literalinclude:: menu_05.py
:caption: Adding input field
:lines: 197
:lines: 223

Adding it to the widget layout.

.. literalinclude:: menu_05.py
:caption: Adding input field to the layout
:lines: 240
:lines: 271

If you paid attention when we defined the ``input_text`` variable we passed the
``text`` parameter with our ``input_text_default`` argument. We basically added
Expand All @@ -271,14 +271,14 @@ toggle label.

.. literalinclude:: menu_05.py
:caption: Adding toggle button
:lines: 199-216
:lines: 225-242

Adding it to the widget layout. Add this line after you have added the input
field.

.. literalinclude:: menu_05.py
:caption: Adding toggle button to the layout
:lines: 241
:lines: 272

Adding a Dropdown
~~~~~~~~~~~~~~~~~
Expand All @@ -287,13 +287,13 @@ We add a dropdown by using :py:class:`~arcade.gui.UIDropdown`.

.. literalinclude:: menu_05.py
:caption: Adding dropdown
:lines: 219-221
:lines: 246-252

Adding it to the widget layout.

.. literalinclude:: menu_05.py
:caption: Adding dropdown to the layout
:lines: 242
:lines: 273

If a dropdown has many options, it will automatically scroll when the list
exceeds the ``max_height`` (default 200px). You can also enable a visible
Expand All @@ -309,13 +309,13 @@ Theres a functionality to style the slider, this is also present for

.. literalinclude:: menu_05.py
:caption: Adding slider
:lines: 223-235
:lines: 254-266

Adding it to the widget layout.

.. literalinclude:: menu_05.py
:caption: Adding slider to the layout
:lines: 243-244
:lines: 274-275

Finishing touches
~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_04.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/04_user_control.py
:caption: 04_user_control.py - User Control
:linenos:
:emphasize-lines: 13-17, 53, 65, 93-121
:emphasize-lines: 13-17, 55, 67, 95-123

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_05.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/05_add_gravity.py
:caption: 05_add_gravity.py - Add Gravity
:linenos:
:emphasize-lines: 18-19, 72-81, 105-123
:emphasize-lines: 18-19, 74-83, 107-125

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_06.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/06_reset.py
:caption: Resetting
:linenos:
:emphasize-lines: 33, 36, 39, 47, 49-93, 114-115
:emphasize-lines: 33, 36, 39, 47, 49-95, 116-117

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_08.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/08_coins.py
:caption: Collecting Coins
:linenos:
:emphasize-lines: 15, 50-51, 68, 90-95, 125, 133-141
:emphasize-lines: 15, 50-51, 70, 92-97, 127, 135-143

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_09.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/09_sound.py
:caption: Load the Map
:linenos:
:emphasize-lines: 56-58, 146, 160
:emphasize-lines: 56-58, 148, 162

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/10_score.py
:caption: Multiple Levels
:linenos:
:emphasize-lines: 56-63, 124-131, 149-153, 171-172
:emphasize-lines: 56-63, 126-133, 151-155, 173-174

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/11_scene.py
:caption: Using a Scene
:linenos:
:emphasize-lines: 39-40, 60, 67, 69-70, 78, 90, 97, 106-108, 149-151
:emphasize-lines: 39-40, 60, 69, 71-72, 80, 92, 99, 108-110, 151-153

Run This Chapter
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/13_more_layers.py
:caption: More Layers
:linenos:
:emphasize-lines: 70-71, 78-83, 152-156
:emphasize-lines: 70-75, 84-89, 158-162
2 changes: 1 addition & 1 deletion doc/tutorials/platform_tutorial/step_14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ Source Code
.. literalinclude:: ../../../arcade/examples/platform_tutorial/14_multiple_levels.py
:caption: Moving the enemies
:linenos:
:emphasize-lines: 57-64, 79-80, 116-119, 173-182
:emphasize-lines: 57-64, 79-84, 122-125, 180-189
Loading
Loading