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
4 changes: 2 additions & 2 deletions arcade/sprite_list/sprite_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SpriteList(Generic[SpriteType]):

def __init__(
self,
use_spatial_hash: Optional[bool] = None,
use_spatial_hash: bool = False,
spatial_hash_cell_size: int = 128,
atlas: Optional["TextureAtlas"] = None,
capacity: int = 100,
Expand Down Expand Up @@ -156,7 +156,7 @@ def __init__(

self._spatial_hash_cell_size = spatial_hash_cell_size
self.spatial_hash: Optional[SpatialHash] = None
if use_spatial_hash is True:
if use_spatial_hash:
self.spatial_hash = SpatialHash(cell_size=self._spatial_hash_cell_size)

self.properties: Optional[Dict[str, Any]] = None
Expand Down
14 changes: 7 additions & 7 deletions arcade/tilemap/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class TileMap:
:param Union[str, Path] map_file: A JSON map file for a Tiled map to initialize from
:param float scaling: Global scaling to apply to all Sprites.
:param Dict[str, Dict[str, Any]] layer_options: Extra parameters for each layer.
:param Optional[bool] use_spatial_hash: If set to True, this will make moving a sprite
:param bool use_spatial_hash: If set to True, this will make moving a sprite
in the SpriteList slower, but it will speed up collision detection
with items in the SpriteList. Great for doing collision detection
with static walls/platforms.
Expand Down Expand Up @@ -179,7 +179,7 @@ def __init__(
map_file: Union[str, Path] = "",
scaling: float = 1.0,
layer_options: Optional[Dict[str, Dict[str, Any]]] = None,
use_spatial_hash: Optional[bool] = None,
use_spatial_hash: bool = False,
hit_box_algorithm: Optional[HitBoxAlgorithm] = None,
tiled_map: Optional[pytiled_parser.TiledMap] = None,
offset: Vec2 = Vec2(0, 0),
Expand Down Expand Up @@ -626,7 +626,7 @@ def _process_image_layer(
layer: pytiled_parser.ImageLayer,
texture_atlas: "TextureAtlas",
scaling: float = 1.0,
use_spatial_hash: Optional[bool] = None,
use_spatial_hash: bool = False,
hit_box_algorithm: Optional[HitBoxAlgorithm] = None,
offset: Vec2 = Vec2(0, 0),
custom_class: Optional[type] = None,
Expand Down Expand Up @@ -717,7 +717,7 @@ def _process_tile_layer(
layer: pytiled_parser.TileLayer,
texture_atlas: "TextureAtlas",
scaling: float = 1.0,
use_spatial_hash: Optional[bool] = None,
use_spatial_hash: bool = False,
hit_box_algorithm: Optional[HitBoxAlgorithm] = None,
offset: Vec2 = Vec2(0, 0),
custom_class: Optional[type] = None,
Expand Down Expand Up @@ -792,7 +792,7 @@ def _process_object_layer(
layer: pytiled_parser.ObjectLayer,
texture_atlas: "TextureAtlas",
scaling: float = 1.0,
use_spatial_hash: Optional[bool] = None,
use_spatial_hash: bool = False,
hit_box_algorithm: Optional[HitBoxAlgorithm] = None,
offset: Vec2 = Vec2(0, 0),
custom_class: Optional[type] = None,
Expand Down Expand Up @@ -984,7 +984,7 @@ def load_tilemap(
map_file: Union[str, Path],
scaling: float = 1.0,
layer_options: Optional[Dict[str, Dict[str, Any]]] = None,
use_spatial_hash: Optional[bool] = None,
use_spatial_hash: bool = False,
hit_box_algorithm: Optional[HitBoxAlgorithm] = None,
offset: Vec2 = Vec2(0, 0),
texture_atlas: Optional["TextureAtlas"] = None,
Expand All @@ -1001,7 +1001,7 @@ def load_tilemap(

:param Union[str, Path] map_file: The JSON map file.
:param float scaling: The global scaling to apply to all Sprite's within the map.
:param Optional[bool] use_spatial_hash: If set to True, this will make moving a sprite
:param bool use_spatial_hash: If set to True, this will make moving a sprite
in the SpriteList slower, but it will speed up collision detection
with items in the SpriteList. Great for doing collision detection
with static walls/platforms.
Expand Down
2 changes: 1 addition & 1 deletion doc/programming_guide/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ API in a way that is not compatible with how it was used in 2.6.
are also using any custom :py:class:`~arcade.TextureAtlas`.
* The GUI package has been changed significantly.
* Buffered shapes (shape list items) have been moved to their own sub-module.
* `use_spatial_hash` parameter for `SpriteList` and `TileMap` is now a `bool` instead of `Optional[bool]`

Featured Updates
~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -2349,4 +2350,3 @@ Enhancements
* `Issue 131 <https://github.com/pvcraven/arcade/issues/131>`_: Add example code on how to do full-screen games
* `Issue 113 <https://github.com/pvcraven/arcade/issues/113>`_: Add example code showing enemy turning around when hitting a wall
* `Issue 67 <https://github.com/pvcraven/arcade/issues/67>`_: Improved support and documentation for joystick/game controllers