Skip to main content

Linux: Ok Windows: Ok Mac OS: Ok GPLv3 license PRs Welcome Documentation Status CII Best Practices CircleCI

hac-game-lib

Hyrule Astronomy Club Game Library- base library for a game development

Name change

With 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 to pygamelib. In the process the whole file/class hierarchy as been reworked.

Therefore the pygamelib 1.2.0+ is not backward compatible with the hac-game-lib. We are talking about name 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 pygamelib

Simply upgrade using pip:

pip3 install --upgrade --user hac-game-lib

This 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 pygamelib

The files and directories naming are now more aligned with PEP 8 and PEP 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 into pygamelib.engine.
  • gamelib.HacExceptions and gamelib.Utils are now unified into pygamelib.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 into pygamelib.board_items.
  • gamelib.Actuators.Actuator, gamelib.Actuators.SimpleActuators, gamelib.Actuators.AdvancedActuators are now unified into pygamelib.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 now pygamelib.assets.
  • gamelib.Assets.Graphics is now pygamelib.assets.graphics.
  • gamelib.Assets.Graphics.Sprites has been renamed to pygamelib.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 to pygamelib.engine.Game.

There is also new modules and features but please see the release notes of pygamelib.

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 changes

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

Metadata

Release files for hac-game-lib 1.1.99

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hac-game-lib 1.1.99
File Size Uploaded
hac-game-lib-1.1.99.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hac-game-lib 1.1.99
File Interpreter ABI Platform
hac_game_lib-1.1.99-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / hac-game-lib-1.1.99.tar.gz

Download URL hac-game-lib-1.1.99.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d7253b031228a2d16f23b9188feec2fe465669975b965a5ca5bced5d2a68a198
BLAKE2b-256 checksum
How to use checksums
ce7c41f21e69de5d0af419a505c214a93a320938b3c8d682f47cc0d3499895c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.8

Release files / hac_game_lib-1.1.99-py3-none-any.whl

Download URL hac_game_lib-1.1.99-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4365793656e699197c5f41aec744dfb0e2ffaec0ab8ccf9f770447ccaece7a0
BLAKE2b-256 checksum
How to use checksums
8c164216f020a5c37dc71284325cca54d36a1d4c80fccc5200eb65801a08f501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.8

Release history Release notifications | RSS feed

This release

1.1.99 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page