pygamelib – v1.2.0 – Release notes

Introduction

Where to start? This release is huge. Gigantic as it brings a lot of new features. But it also breaks many things. Not literally break, in 98% of the case your code just need a bit of imports translation. There’s always the 2% though… We’ll see about that.

Overview

  • Renamed the entire library from hac-game-lib to pygamelib.
  • Breaking change: The library has been heavily refactored and this creates some issues. Please have a look at the migration notes.
  • New feature: Items that can be represented on more than one cell. We call them complex items. There’s a lot of new complex items: ComplexPlayer and ComplexNPC of course, but also ComplexWall, ComplexDoor, ComplexTreasure and the general purpose Tile object.
  • New feature: Going with complex items, we now have a proper sprite system with the gfx.core.Sprite class.
  • New feature: In addition to the regular model we now have a new concept: the Sprixel. A Sprite is made of many Sprixels.
  • New feature: New JSON based file format to save, load and distribute sprites and/or sprixels.
  • New feature: All these sprites can be grouped into a SpriteCollection that in turn can be saved in our new sprite file format.
  • New feature: New Math library. This one starts small but will grow. It makes calculating the distance and intersections easier.
  • New feature: New Vector2D class to represent forces and movement as a vector. It is now possible to give a vector to the move() method.
  • New feature: Gave some love to text. There are now 2 objects dedicated to text: base.Text to manipulate text and board_items.TextItem to easily place text on a board.
  • New feature: A Screen object has been added to make the screen manipulation simpler.
  • New feature: The Game object now has a run() method that act as the main game loop. It calls a user defined update function and takes care of a lot of things. It runs until the Game.state is set to STOPPED.
  • New feature: The Game object can now turn by turn or real time. All movables can be configured to have time based or turn based movement speed.
  • Improvement: The Animation class now support both regular strings (models), Sprixel and Sprite.
  • Improvement: All complex items obviously support (actually requires) sprites but all regular board items now supports sprixels.
  • Improvement: Test coverage dramatically improved. It has jumped from 25% to 98%.
  • Improvement: Lots of objects now have attributes to easily access and/or set properties like position (mostly read only), width, height, etc.
  • Improvement: Converted the editor to pygamelib and renamed it pgl-editor.py. Also added a multi page selector and integrated the new graphic assets.
  • Improvement: All movables can now have different vertical and horizontal "steps" parameters.
  • Cleaned up the repository (it was becoming seriously messy).
  • Change the prefix of all exceptions from Hac to Pgl.
  • Added a NO_PLAYER constant to tell the game object that he should not expect a player object.
  • Improve the generated documentation.
  • Various improvements in exceptions raising across the library. Please see the documentation (that was also updated).
  • Various bug fixing in the Suparex example.

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!!!).

Release details

Let’s see what it looks like in more details.

Statistics

Item Data
Files changed 181
Additions 24065
Deletions 8981
Commits 142

The full list is available on Github.

Breaking changes

There’s a lot of breaking changes, please see the article on the wiki about migration

Deprecation

Following the depreciation of the emoji based Sprite modules and this module to be moved to the assets submodule, it has been removed from the library entirely. Actually, since we now have a "real" sprite system, the old Assets.Sprite class has been renamed and moved to pygamelib.assets.graphics.Models

Documentation

The documentation index has been reworked to give a better access to the whole library more easily.

All new classes have been documented with examples.

Bugfixes

There was a couple of bugfixes in the midst of all the new features but they were mostly side effects.

Improvements / New features

This release brings a lot of new features and various improvements. See the overview for a complete list.

Considering the magnitude of most of the new features I’ll make dedicated articles and videos in the upcoming days and weeks.

Conclusion

This release is marks a new high in the amount of feature delivered! I hope that you are going to enjoy it!

The new release is available on PyPi and on Github of course. The pypi archive deprecates the previous version of the hac-game-lib in favor of the newly created pygamelib package.

As usual, to install that new version, we strongly recommend to do it in a virtual environment:

pip3 install virtualenv --user
virtualenv pgl
cd pgl
source bin/activate
pip3 install pygamelib 

But if you just want the pygamelib to be available more widely:

pip3 install --user pygamelib

As a closing thought, Gally was not that good in the end, pygamelib is better 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s