Skip to content

Scene improvements #1651

Closed
Closed
@einarf

Description

@einarf

The current sprite_lists and name_mapping members are "public". Some users are modifying these directly causing issues that are hard to debug and understand. We should make them private and add additional tools if needed.

arcade/arcade/scene.py

Lines 30 to 32 in 98d4cac

def __init__(self) -> None:
self.sprite_lists: List[SpriteList] = []
self.name_mapping: Dict[str, SpriteList] = {}

Things like __len__ and __delitem__ are candidates here.

On a few occations users have been deleting spritelists from name_mapping thinking that this will remove the spritelist. For more dynamic worlds this means you end up with hundres of spritelists in spritelists and performance tanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions