Changelog
Release notes for PyKraken.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning when possible.
[1.6.1] - 2026-02-15
Added
- New
mixersubmodule for advanced audio management. AudioPriorityenum for managing hardware track acquisition (MUSIC, UI, SFX).- Support for polyphonic sound effects via the
Sampleclass andmax_polyphonyattribute. - Priority-based track stealing: high-priority sounds can now interrupt lower-priority ones if the 64-track limit is reached.
- Global master volume control via
mixer.set_master_volume. draw.ellipsesanddraw.linesfunctions for drawing multiple ellipses or lines in a single call.- Added
is_convexandis_concavemethods to thePolygonclass for checking polygon convexity. - Added
Circledefault constructor and another accepting just a radius. - New
physicssubmodule with aWorldclass, bodies, and joints for basic 2D physics simulation.Bodyabstract class for physics bodies:RigidBodyfor simulating solid objects with mass, velocity, and forces.CharacterBodyfor simulating character-like movement with floor detection and snapping.StaticBodyfor immovable objects that can still collide with other bodies.
Jointabstract class for the following joint types:DistanceJointfor maintaining a fixed distance between two bodies.FilterJointfor filtering collisions between two bodies.MotorJointfor applying a motor force to maintain a relative position between two bodies.PrismaticJointfor allowing relative movement along a specified axis between two bodies.RevoluteJointfor allowing relative rotation between two bodies.MouseJointfor dragging a body with the mouse cursor.WeldJointfor rigidly connecting two bodies together.WheelJointfor allowing relative rotation and translation along a specified axis between two bodies.
Collisionclass for representing collision information between two bodies. Provided viaWorld.get_collisions()method.CastHitclass for representing the result of a ray or shape cast in the physics world.- Added
Capsuleshape class for physics bodies, defined by a line segment and a radius. - Added
draw.capsuleanddraw.capsulesfunctions for drawing capsules. get/set_fixed_deltaandget/set_max_substepsfunctions for managing physics stepping parameters.add_fixed_updateandclear_fixed_updatesfunctions andfixed_callbackdecorator for registering functions to be called at a fixed interval during the automatic physics update loop.- Add
Map.tile_layers,Map.object_groups, andMap.image_layersproperties for easier access to specific layer types. - Add
Map.get_layer(name)method for retrieving a layer by name. - Add
World.from_map_layer(world, layer)method for creating physics bodies from a tilemap layer. Vec2can be divided by anotherVec2element-wise using the/operator.- New
draw.bezieranddraw.sectorfunctions for drawing Bezier curves and circular sectors. - Added
draw.polylinefor drawing connected line segments. world_to_screenandscreen_to_worldfunctions/methods for converting between world and screen coordinates.camera.get_active_posfunction for getting the position of the currently active camera.
Changed
- Refactored the audio backend to use SDL3_mixer.
- Renamed
Audioclass toSample(for short sound effects). - Renamed
AudioStreamclass toStream(for long music files).
- Renamed
- Audio loading functions moved to
mixer.load_sampleandmixer.load_stream. Stream.loopingis now an RW property instead of just a setter method.Streamplayback position renamed fromcurrent_timetoplayback_pos.- Circle drawing (and now ellipses) default segment count reduced from 36 to 24.
- Line drawing thickness can now be a float.
- Rename
Map.layerstoMap.all_layers Textureconstructor involving aVec2size parameter changed to accept separatewidthandheightinteger parameters for type safety.AnimationController.add_sheetmethodVec2frame size parameter changed to separateframe_widthandframe_heightinteger parameters for type safety.draw.rectanddraw.rectsfunctions now have parameters for corner radii.
Fixed
- Fixed a bug where textures wouldn't render at all (hopefully). Likely related to the internal SDL2->SDL3 transition.
Removed
- Removed
rewindmethod from audio stream class (useseek(0)or restart playback). - Removed
miniaudiodependency. - Removed
SGL_gfxdependency. - Due to the new CharacterBody class, I've decided to remove the
Spriteclass as it become redundant.
[1.6.0] - 2026-01-29
Added
- Added
Vec2.ZERO,Vec2.UP,Vec2.DOWN,Vec2.LEFT, andVec2.RIGHTconstants for common vector directions. - Added the ability to multiply two
Vec2objects element-wise using the*operator. - New
transformsubmodule withcomposeandcompose_chainfunctions for parenting transforms. - New
draw.circlesfunction for drawing multiple circles in a single call (~3.5x faster than multipledraw.circlecalls in testing). - New
draw.polygonsfunction for drawing multiple polygons in a single call. - Added
texture.clip_areaproperty for getting/setting the texture's clipping area. - Added
draw.geometryfunction for drawing arbitrary vertex geometry, optionally with a texture. - New
Vertexclass representing a single vertex with position, color, and texture coordinate attributes.
Changed
Vec2boolean conversion now checks for both components being exactly zero, rather than using a tolerance.fx.move_tofunction now requires aVec2for theposparameter instead of accepting an optional argument of any object type.- Greatly improved quality and performance of
draw.circleanddraw.polygonby switching to a GPU-based rendering approach. - Animation controller's
load_sprite_sheetmethod renamed toadd_sheetandclipproperty renamed toframe_area. renderer.drawfunction now accepts optionalanchorandpivotparameters for specifying the drawing anchor and pivot points, both ofVec2type.- Both text and pixel array drawing functions now accept an optional
anchorparameter ofVec2type for specifying the drawing anchor point. Anchorenum changed to a class with static constants for common anchor points represented asVec2objects.- Renamed tilemap layer
rendermethods todrawfor consistency with other drawing functions.
Removed
- Implicit conversians from sequences to
Vec2,Rect,Line,Color, andPolarCoordinatehave been removed for better type safety. Use explicit constructors instead. - Removed
srcparameter fromrenderer.drawfunction. - Removed
clipattribute fromSpriteclass. Transformclass no longer containspivot,size, oranchorattributes.- Removed most opaque list types except for tilemap related ones due to... uselessness.
[1.5.0] - 2025-12-31
Added
- Added
build.pyscript for automating build and compilation tasks. - Added
tilemapsubmodule for working with tile maps. - Added
Vec2methodsmove_towardand non-mutatingmoved_towardfor moving a vector towards a target vector by a specified maximum distance.
Fixed
- Most evident with animations and tilemaps, fixed a visual artifact where textures would render slightly offset when using the camera. The fix? Flooring the camera's position before rendering.
Changed
- Completely reworked tile maps in Kraken, supporting:
- Tile, Object (of all kinds), and Image layers
- Terrains in tilesets
- More than one tileset per map
- Text properties
- Binded functions that return or accept references to list types no longer make copies of the list, but use opaque references to the original list.
- Improved error handling in rendering and draw functions.
- Rendering and draw operations now properly cull objects outside the current viewport; zero-opacity objects are also culled.
- Moved
mathfunctions toVec2class methods:math.scale_to_length->Vec2.scaled_to_lengthmath.normalize->Vec2.normalizedmath.rotate->Vec2.rotated
Removed
- Removed
<,>,<=,>=operators fromVec2class due to ambiguity with element-wise comparisons. - Removed
from_polarfunction from themathsubmodule (see "Changed" for other math functions).
[1.4.2] - 2025-12-21
Added
renderer.set_target(target: Texture)function for setting/unsetting render target textures.TextureAccessenum for specifying texture access modes (STATIC/TARGET).TextureScaleModeenum for specifying texture scaling modes (LINEAR/NEAREST/PIXEL_ART).- New
Textureconstructor that only requires size for creating render target textures. renderer.set_default_scale_mode(scale_mode: TextureScaleMode)andrenderer.get_default_scale_mode()functions for managing default texture scale modes.
Changed
renderer.get_res()renamed torenderer.get_target_resolution().window.create(title, resolution, scaled)parameters changed towindow.create(title, size).- All
Textureconstructors updated to haveTextureAccessandTextureScaleModeparameters.
Removed
- Removed
AnimationController.textureproperty. - Removed unused
Animationstruct binding. - Removed
file_pathparameter fromAnimationController.load_sprite_sheetmethod.