Skip to content

Kraken Engine v1.6.1

Latest

Choose a tag to compare

@durkisneer1 durkisneer1 released this 16 Feb 00:49
· 1 commit to main since this release
3d455da

Experimental Physics & Better Audio Update

This release is a massive quality-of-life + capability jump: a brand-new Box2Dv3-powered physics module, a modernized audio backend (now SDL3_mixer), and a bunch of new drawing + tilemap conveniences.


Major Additions

Physics

  • Added a new physics submodule built on Box2D v3, centered around physics.World and physics.Body APIs.
  • Physics function include:
    • get_fixed_delta and set_fixed_delta for managing physics stepping
    • add_fixed_update and fixed_callback decorator to register a function to be called per physics step.
    • clear_fixed_updates to deregister all currently registered function callbacks.
  • Added body subtypes to match common gameplay needs:
    • RigidBody for simulating solid objects with mass, velocity, and forces.
    • StaticBody for immovable objects that can still collide with other bodies.
    • CharacterBody for simulating character-like movement with floor detection and snapping.
  • Added joint support with an abstract Joint base and multiple joint subtypes and point/AABB queries and cast helpers:
    • DistanceJoint for maintaining a fixed distance between two bodies.
    • FilterJoint for filtering collisions between two bodies.
    • MotorJoint for applying a motor force to maintain a relative position between two bodies.
    • PrismaticJoint for allowing relative movement along a specified axis between two bodies.
    • RevoluteJoint for allowing relative rotation between two bodies.
    • MouseJoint for dragging a body with the mouse cursor.
    • WeldJoint for rigidly connecting two bodies together.
    • WheelJoint for allowing relative rotation and translation along a specified axis between two bodies.
  • Worlds have per-body collision filtering (collision_layer / collision_mask) and TileMap → physics helpers to form a static body out of a tile map's object group layer.
  • Collision class representing collision information between two physics bodies, obtained via the World.get_collisions method.
  • CastHit class representing the result of a ray or shape cast in physics space.

Audio

  • Introduced a new mixer submodule with AudioPriority (MUSIC, UI, SFX), priority-based track stealing, and global master volume control.
  • mixer.Audio base class with subtypes that replace the old API:
    • Audiomixer.Sample for short sound bites to be played polyphonically.
    • AudioStreammixer.Stream for long sound tracks, like music, with more playback control.
  • Samples and streams must be loaded with the mixer.load_sample and mixer.load_stream functions.

Drawing & Geometry

  • New shape drawing functions:
    • draw.ellipses
    • draw.lines
    • draw.capsule and draw.capsules
    • draw.bezier (3 and 4 point)
    • draw.sector (with thickness parameter for arcs)
    • draw.polyline
  • New Capsule shape object for drawing and use with physics implementations.
  • Polygon.is_concave and is_convex methods for checking shape convexity.
  • Circle constructor can now accept just a radius (position initializes at (0, 0))
  • draw.rect and draw.rects functions now accept five new arguments for rounded corners (in order):
    • border_radius to set all corner radii uniformly
    • radius_top_left to override top left radius
    • radius_top_right to override top right radius
    • radius_bottom_right to override bottom right radius
    • radius_bottom_left to override bottom left radius

TileMap Conveniences

  • Added helper APIs in the tilemap.Map class:
    • get_layer()
    • layersall_layers
    • tile_layers
    • object_groups
    • image_layers

Refactors & Improvements

  • Text construction now allows an optional initial string.
  • Vec2 now supports element-wise division with / and /=.
  • Fixed a bug that I believe to have emerged from the SDL2 → SDL3 backend upgrade where textures weren't rendering at all.

Removals & Breaking Changes

  • Texture constructor size parameter are now two integers instead of a Vec2.
  • AnimationController.add_sheet size parameter now takes two integers instead of a Vec2.
  • Removed redundant Sprite class, CharacterBody recommended instead.
  • Audio stream class rewind removed in favor of just using seek(0).

Full Changelog: v1.6.0...v1.6.1

Thank you for using PyKraken!