Unbearably Fun Game Development
by Jamie
The big headline is the Asset Revamp. Instead of just passing around strings (and the whole resource path concept), actual Asset
objects are given to systems. (api reference,
As part of this, we’ve introduced the concept of a Virtual File System (VFS). The VFS allows assets to be loaded from the Python Path (sys.path
), using the same structure as python modules. This simplifies the usage of asset packs (like ppb-mutant) and allows assets not tied to a sprite (namely sound effects) to work.
As a quick example this v0.6 code:
class MySprite(ppb.BaseSprite):
image = 'thingy.png'
resource_path = 'resources/sprites'
becomes this v0.7 code:
class MySprite(ppb.Sprite):
image = ppb.Image('resources/sprites/thingy.png`)
You may also notice that ppb.BaseSprite
became ppb.Sprite
. This is the result of a bunch of refactoring, and the old name is now deprecated and will be removed in a future release.
Also part of this effort is that there’s three generated image assets available: ppb.Circle
, ppb.Square
, and ppb.Triangle
. Instead of loading data from a file, these generate basic shapes in memory.
The lesser headline is the addition of sound effects! (
Note that the warning about PyGame and Python version compatibility from the v0.6 release notes still apply. In summary: Do not use PyGame 2 or Python 3.8 at this time.
Added:
ppb.vfs
module - Enables loading of files from Python packages (#306)AbstractAsset
ABC (#329)AssetLoaded
event (#315)ppb.Circle
, ppb.Square
, and ppb.Triangle
generated images (#363)ppb.Sprite
is now the base sprite class (#357)ppb.run()
accepts arbitrary engine and subsystem arguments (#307)Changed:
ppb.BaseSprite
is now deprecated in favor of ppb.Sprite
(#357)Removed:
__resource_path__()
protocol removed in favor of ppb.vfs
(#306)Invisible:
ppb.sprites.BaseSprite
now truly just a base class, using mixins to provide features. (#357)
ppb.sprites.SquareShapeMixin
(#357)ppb.sprites.RenderableMixin
(#357)ppb_vector
(#303)