A (not so) small python library for console (as in terminal) game development. It is developed as a framework to help learn development and python in an entertaining way.
This release is massive. Please read the documentation for specific changes to classes. It is available at https://pygamelib.readthedocs.io/en/latest/index.html.
Important one: the whole pygamelib has been migrated to its own Github organization: https://github.com/pygamelib please update your links! The library's repository is now available at https://github.com/pygamelib/pygamelib.
If you want to see a quick video of the capabilities of that version it's here:
And for a quick rundown of the main updates, it's here:
pygamelib.engine.Screen
class now has a new Improved Screen Management double buffered system. This set of methods allow for a simplified management of the console screen. It is also faster than the Legacy Direct Display system. Please read the documentation (https://pygamelib.readthedocs.io/en/latest/pygamelib.engine.Screen.html) and the wiki on the Github repository for more about the differences. You will probably want to switch to the new stack as soon as possible. Both systems are clearly identified in the documentation by visible tags. Most of the new features of this release are NOT compatible with the Legacy Direct Display system. It still received updates and new features but will probably be deprecated in future updates.pygamelib.gfx.ui
module! The beginning of a module for all your game/application user interface needs. The module is in alpha for the moment, feel free to voice your feedback. This module is only compatible with the Improved Screen Management.pygamelib.engine.Game
can now be created as a Singleton through the instance()
method.pygamelib.gfx.particles
submodule. This module is only compatible with the Improved Screen Management.pygamelib.gfx.core.Font
, a Sprite based font system. This release come with an "8bits" font and a couple of font imported from FIGlet!pygamelib.gfx.core.Color
) to entirely abstract the color system.serialize()
and load()
methods.pygamelib.base.PglBaseObject
, all objects that inherits from python's object
are now inheriting from this new one. It implements a couple of base features but the most important is the modified Observer
design pattern that is the base of a refactoring to event base communication within the library.pygamelib.board_item.Camera
. It is a specific item that is not shown on the board. It can be used for cinematic for example. Please read the documentation for more information.Board
object has been reworked to allow for a third dimension. It now has a new property called layer
. Layers are automatically added and removed to fit the need of overlapping items. Board.place_item()
also accept a new layer parameter to set the layer (if you want to put stuff over the player for example). An example is visible here: https://www.youtube.com/watch?v=9cOt63ZAJOk.pygamelib.engine.Board
and for pygamelib.engine.Screen
.pygamelib.gfx.core.Sprite
can now be tinted or modulated with a color. Both operation do the same thing: change the color of the sprite by applying a color at a given ratio. However, tint()
returns a new sprite and does not modify the original sprite while modulate()
returns nothing and modify the sprite directly.pygamelib.board_items.BoardItem
constructor parameter changed: type
is now item_type
.pygamelib.board_items.BoardItem
: there was a conflict with inventory_space
. It was defined both as a property and a method. The method has been removed and BoardItem.inventory_space
is now a proper python property. Concretely: you might have to remove parenthesis when using any_item.inventory_space
(vs the old any_item.inventory_space()
).pygamelib.gfx.core.Color
replaces Terminal.on_color_rgb()
and Terminal.color_rgb()
. It is much easier to use (just use the Color object and the pygamelib will manage foreground and background differences) but it requires to change the initialization of every Sprixel and Text of your game (sorry...).Board.partial_display_focus
. It is not breaking anything in existing code but it will not behave as you want is you just Screen.place()
your board (that uses partial display) without setting the partial_display_focus
to the player first.pygamelib.constants.NO_DIR
if there is no direction available to next_move()
. This makes the actuators behavior more consistent particularly when they are overloaded.RandomActuator
behavior has been reworked. It now choose a direction and follow it for a certain distance before choosing a new direction. It also detect when it is stuck an, in that case, pick a new direction.display_sprite()
and display_sprite_at()
method to Screen. These methods can display a pygamelib.gfx.core.Sprite
on screen.BoardItem
now have configurable properties for restorable
, overlappable
, pickable
and can_move
.pygamelib.board_items.BoardComplexItem.sprite
is now a @property
instead of a class variable. That property automatically call update_sprite()
.Game.mode
is set to pygamelib.constants.MODE_RT
, all pygamelib.board_items.Movable
now accumulate movement vectors (when using vectors). This means that non unit movement patterns are now possible.pygamelib.base.Console
implements a Singleton design pattern. You can now get a unique reference to the blessed.Terminal
(the object wrapped in Console) object by calling Console.instance()
.pygamelib.engine.Screen.display_at()
: it was not possible to display anything after (below a Board). It is now possible.pygamelib.base.Text
has improved a lot. It can now use the Font system, has new attributes and is now a PglBaseObject
. Please read the documentation for more.Sprixel.copy()
and Sprite.copy()
.Sprite.set_transparency()
.restorable
items: now all board items can be set to be restorable.pygamelib.engine.Game
where the partial display settings (when set at in the Game instance), were not correctly passed down to the Board.I would like to thank all the contributors (https://pygamelib.readthedocs.io/en/latest/authors.html) for their work on this massive update.
The new pygamelib logo was done by an awesome artist: Jack Tseng (https://hellojacktseng.carrd.co/ https://twitter.com/HelloJackTseng) please have a look at their amazing work!!
Full Changelog: https://github.com/pygamelib/pygamelib/compare/v1.2.3...v1.3.0
Emergency release: fix a regression introduced by v1.2.2.
Quick bugfix release mainly targeted at Windows and older Python versions.
The official debut of the pygamelib! A big update from the previous (hac-game-lib) v1.1.1 that includes sprite support and more variety of use cases. Please have a look at the wiki and the tech blog for articles and videos in the upcoming days and weeks.
Here is the list of major changes:
I also need to give some kudos to the kids of the Hyrule Astronomy Club for thorough testing of Suparex. They found well hidden bug and exploitable bugs. Special thanks to Arthur who found many glitches. Congratulations to Arthur and Hadrien that successfully exploited them to achieve extremely high scores (up to 12000!!!).
Fun fact: I reserved the pypi namespace with a fake 1.2.0 release and guess what: you cannot re-use the name of a deleted version...
The release of the stable version 1.1.0 of the hac-game-lib include the following changes:
Please see the full release announcement for an extended list of the changes.
Release of the bugfix public release 1.0.1. It includes:
Full announcement is available at https://astro.hyrul.es/news/hac-game-lib-v1.0.1-release-notes.html
Release of the 2020.3 version including all contributions from Hacktoberfest:
Full announcement at https://astro.hyrul.es/news/hac-game-lib-v1.0.0-release-notes.html
Release of the 2020.3 version including all contributions from Hacktoberfest: