Parameters: |
|
---|
Note
Make sure to call super().__init__() if overriding to ensure World instance is set up correctly.
If the Entity should render.
If the Entity should respond to collision checks.
The Screen object to draw the entity onto. Leave as None to render to the primary window.
Override this, called every frame by the current World as part of the main game loop.
Renders the Entity’s Graphic. If you override this to implement additional behaviour, remember to call super().render() to ensure the Entity is drawn.
Checks for a collision between the Entity, positioned at (x, y), and an Entity of type t. Returns the first Entity collided with, or None if there was no collision.
Returns whether the Entity, positioned at (x, y), overlaps the specified rectangle at (r_x, r_y) with dimensions r_width x r_height.
Returns whether this Entity, positioned at (x, y), overlaps the specified position (p_x, p_y)
Todo
Read only. The World object this Entity has been added to.
The rendering layer of this entity. Higher layers are rendered first.
The collision type, used for collision checks.
Todo
Mask support.
Graphic object to render to the screen during the render loop.
Adds the Graphic g to the Entity via a Graphicslist
Sets the Entity’s hitbox properties.
Sets the Entity’s hitbox to math that of the provided object o.
Sets the origin of the Entity to (x, y).
Sets the Entity’s origin to (width/2, height/2).
Todo