Skip to main content

A basic game engine built around pyglet

Project description

amonite

A simple game engine built around pyglet.

PyPi page:
https://pypi.org/project/amonite/

Settings

You can change game settings by creating and manually editing a settings json file:

Debug

  • debug -> General debug setting, shows some useful features such as update time, render time and collisions.
  • show_collisions -> Specific debug setting, shows collisions, but only if debug is true
  • show_tiles_grid -> Specific debug setting, shows tilemap grid lines.
  • free_cam_bounds -> Specific debug setting, allows the player to see beyond camera bounds.

Texts

  • title -> Game title: defines the title of the game window.
  • font_name -> Game font; if you don't have the font installed, then an error will occur.

Rendering

  • view_width -> Base view width, defines the amount of pixels you can see horizontally
  • view_height -> Base view height, defines the amount of pixels you can see vertically
  • pixel_perfect -> Unused.
  • window_width -> Actual window width in pixels (only used if not fullscreen).
  • window_height -> Actual window height in pixels (only used if not fullscreen).
  • fullscreen -> Fullscreen mode toggle.

Misc

  • target_fps -> Target FPS; keep this value high if you don't want any lags.
  • camera_speed -> The speed at which the camera follows the player, the higher the speed, the closer it will be to the player.
  • layers_z_spacing -> Distance between rendered layers on the Z axis.
  • tilemap_buffer -> Width (in tiles number) of tilemap buffer, a higher tilemap buffer will reduce room size.

Sound

  • sound -> General sound setting, defines whether the game plays audio or not.
  • music -> Specific sound setting, defines whether the game plays music or not.
  • sfx -> Specific sound setting, defines whether the game plays sound effects or not.

Animations

All animations can be defined via a simple json definition file.
Animation files are defined as follows:

  • name[string]: name of the animation.
  • path[string]: path to the animation file (starting from the application-defined assets directory).
  • anchor_x[int][optional]: the x component of the animation anchor point.
  • anchor_y[int][optional]: the y component of the animation anchor point.
  • center_x[bool][optional]: whether the animation should be centered on the x axis. If present, this overrides the "anchor_x" parameter.
  • center_y[bool][optional]: whether the animation should be centered on the y axis. If present, this overrides the "anchor_y" parameter.
  • duration[float][optional]: the duration of each animation frame.
  • loop[bool][optional]: whether the animation should loop or not.

Examples

Inventory

The inventory structure (sections, sizes etc) is defined by a json file made up as follows:

  • sections[array]: array of all inventory sections, each defined as follows:
    • size[string]: string representation of the section size (in slots count), encoded as "[width],[height]".
    • name[string]: name of the section, used to section to section linkage.
    • overflows[object]: links to other sections upon overflow: tells which section the cursor should go to when overflowing in each direction. The go to for each overflow can be the name of another section or the "wrap" keyword, which means wrapping around itself keeping the other index unchanged.
      • top[string]: section to go to when overflowing to the top.
      • bottom[string]: section to go to when overflowing to the bottom.
      • left[string]: section to go to when overflowing to the left.
      • right[string]: section to go to when overflowing to the right.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amonite-0.1.11.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amonite-0.1.11-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file amonite-0.1.11.tar.gz.

File metadata

  • Download URL: amonite-0.1.11.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for amonite-0.1.11.tar.gz
Algorithm Hash digest
SHA256 ae3ebad120099c7dccdc9f6500283a779058163a14f1537bbf229ad7c4c11141
MD5 5e26668cbbcc2a3ed104b65a6c25925e
BLAKE2b-256 5799a902d9cad4b75cc6e094a4d079ce312997bb754eaeca3da3db5511f52a04

See more details on using hashes here.

File details

Details for the file amonite-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: amonite-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for amonite-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 73e2f01012b1cd4933e9e51072a838f83260c8b57a50e90d037c5f454f859565
MD5 0ea8e69cd419b17d8e98db4f818a9088
BLAKE2b-256 6ce1452ad02cbd3ffafcc6c486ab6d2f1438b175a2d4a7cbb9f0952b279659cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page