Updated by Engine, main game container that holds all currently active Entities.
Useful for organization, eg. “Menu”, “Level1”, etc.
Todo
Usage example, etc.
Note
Make sure to call super().__init__() if overriding to ensure World instance is set up correctly.
If False, the World will not be rendered.
Point used to modify location entities are drawn at.
Override this; called when the World is changed, and is set to the currently active world.
Override this; called when the World is changed, and the active world is no longer this.
Executed by the game loop, updates/renders all contained Entities.
Note
If you override these to give your World update/render code, remeber to call super().update() or your Entities will not be updated/rendered.
Adds/removes Entity e to/from the World at the end of the frame. Returns the added/removed Entity.
Adds/removes passed Entities to/from the World at the end of the frame. If the first argument is a list, it will be used instead.
Removes all Entities from the World at the end of the frame.
Todo
Mask handling.
Brings/sends the Entity e to the front/back of it’s containing layer. Returns True if successful.
Brings/sends the Entity e once position towards the front/back of it’s containing layer. Returns True if successful.
Todo
Collide Functions.
Read only. Number of Entities that are in the World.
Returns the number of Entities of the type t that are in the World.
Returns the number of Entities of the class c that are in the World.
Returns the number of Entities on the layer l.
Read only. The first Entity in the World update order.
Read only. Number of Entity layers the World has.
The first Entity of type t.
The first Entity of class c.
Read only. The number of different types that have been added to the World.
Adds all Entities of type t to provided list into.
Adds all Entities of class c to provided list into.
Adds all Entities on layer l to provided list into.
Adds all Entities in World to provided list into.