Package: hac-game-lib
hac-game-libHyrule Astronomy Club Game Library- base library for a game developmentName changeWith the growing popularity of the library we decided that it could not longer be named after our little science club.So we took the decision to rename it topygamelib. In the process the whole file/class hierarchy as been reworked.Therefore the pygamelib 1.2.0+ isnotbackward compatible with the hac-game-lib. We are talking aboutname compatibility,
the conversion to the new library is very easy (please see bellow for a guide). Everything else is 100% compatible (it's the same library coded by the same people).How to upgrade to pygamelibSimply upgrade using pip:pip3install--upgrade--userhac-game-libThis will automatically install pygamelib and obsoletes the hac-game-lib module.If you want to install system wide, not just for your current user, remove the --user option from the command line.Convert from the hac-game-lib to pygamelibThe files and directories naming are now more aligned withPEP 8andPEP 423.
We used the fact that renaming and restructuring was going to break everything to reduce the proliferation of modules with just one class. We rationalized a bit.So without further ado:gamelib.Game, gamelib.Board, gamelib.Inventory are now unified intopygamelib.engine.gamelib.HacExceptions and gamelib.Utils are now unified intopygamelib.base. For exceptions, Hac prefix was replaced by Pgl but for convenience mirror classes were added to not break existing games.gamelib.BoardItems, gamelib.Movable, gamelib.Immovable, gamelib.Characters and gamelib.Structures are now unified intopygamelib.board_items.gamelib.Actuators.Actuator, gamelib.Actuators.SimpleActuators, gamelib.Actuators.AdvancedActuators are now unified intopygamelib.actuators.gamelib.Sprites was deprecated in version 1.1.0 in favor of gamelib.Assets.Graphics.Sprites and is now removed (please continue reading).gamelib.Assets is nowpygamelib.assets.gamelib.Assets.Graphics is nowpygamelib.assets.graphics.gamelib.Assets.Graphics.Sprites has been renamed topygamelib.assets.graphics.Models.The gamelib.Utils module is the one that is probably going to require the most attention. It is being exploded and removed.The colored squares and rectangle are now in pygamelib.assets.graphics with the exact same name.The coloring text functions have been moved to a new Text class in pygamelib.base.the get_key() function was moved topygamelib.engine.Game.There is also new modules and features but please see the release notes ofpygamelib.The general idea is to limit the number of imports and to group things by functional similitude.Hopefully it's not too much work to convert your software.Real breaking changesThere is a couple of things that changed and are breaking previous implementations:BoardItem.size() -> BoardItem.inventory_space(): with the introduction of pygamelib.gfx.core.Sprite and BoardComplexItem we needed to have actual item's size. Previously size was used to calculate how much space was used in the inventory. The internals are up to date but if you were using the size attribute, you should pay attention to that change.Projectile: *args replaced by callback_parameters. In the Projectile class, the extra parameters passed to the hit_callback were a mess. So it is now using the same formalism than the GenericActionableStructure.There is also a lot of class variables that were changed into properties. Please read the documentation.
In case it was not clear Sprites (pygamelib.gfx.core.Sprite) are not describing the same thing as before (formerly pygamelib.Assets.Sprites now pygamelib.assets.graphics.Models).