Key Features
- Optimized collision detection with Quadtrees, speeding up high-demand simulations significantly.
Breaking Changes
- z_indexes completely reworked.
- Some setup, draw, and update methods deprecated in some classes.
- Camera position is now where it looks at. ie. default camera position is now `Display.center`.
- Reorder constructor parameters for most classes.
- Removed `Game.scenes`, moving most `SceneManager` code into `Game`.
- Renamed several internal `Time` attributes to better describe what they are.
- Renamed `Vector.random_inside_unit_circle()` to `Vector.rand_unit_vector()`
Added
- `Component` now has a z_index
- true_z property for components which gets the z_index of the `Component` offset by its parent `GameObject`
- `Time.scheduled_call()` for a self-correcting recurring method call on a timed interval.
- clone functions for `Group`, `GameObject`, and `Scene`.
- `Draw.texture` and `Draw.queue_texture` to draw textures to the renderer
- `Draw.sprite` and `Draw.queue_sprite` to draw sprites to the renderer
- `Sprite` class to draw images that are not linked to Game Objects
- `wrap()` function can create and populate a GameObject with component(s) automatically.
- `world_mouse()` function to easily get the mouse position translated into world-coordinates
- Support for operations with Vectors using tuples and lists, meaning less objects need to be created. (note that no
length checking occurs, so make sure your tuples and lists are of length 2).
- `raise_operator_error()` function to raise an error about an operator in a Pythonic style.
- `Scene.switch()` instance method that allows users to switch to a scene without calling `Game.set_scene(scene_id)`
- `Game.draw` and `Game.update` functions, both of which are overrideable, to give user-defineable functionality not
reliant on scenes.
- `Group.contains()` method for checking whether a group or gameobject has already been added to it.
- `Hitbox.contains_pt` method for checking whether a point is inside a hitbox (useful in buttons and the like)
Changed
- Made `Time.now()` a function instead of a property.
- Refactored collision detection code to not report contact points, since we don't need them anymore.
- Added `hidden` attribute to all components and removed `visible` attribute from `Animation`, `Image`, and `Raster`
- Moved `border_color` and `background_color` to individual `Scene` objects instead of a single attribute for the
whole game.
- Restructured the internal file heirarchy. Should not affect normal library useage at all.
- Default border color in draw functions from `Color.green` to `Color.clear`
- Use `Draw.{thing}` to draw immediately and `Draw.queue_{thing}` to draw with a specific z_index. (replace {thing}
with the draw function of your choice)
- Switching scenes now only takes effect on the next frame.
- Reordered `Draw.clear` params to be more intuitive.
- Renderer is automatically cleared if no scene exists.
Removed
- z_index from `Group`
- Misc. unused draw, setup, and update methods for some classes.
- Advanced rotational physics. Will be added in a later patch once Hitbox is refactored.
- Vector `unit()` method. Use `normalized()` or `normalize()` instead.
Fixed
- Resizing an `Image` now works.
- Updated all clone functions to work with new stuff.
- Changing the camera zoom now affects all Sprites.
- Made vector operations more complete and raise errors properly.
- `Group.count()` not working properly.