Skip to main content

A library for making simple 2D games

Project description

Emeralx is a Python package for creating small games, developed based on Pygame, with the aim of changing the loop-refresh method to a multithreaded approach. The Emeralx library is suitable for making 2D games and currently has four modules: display, events, image, and entity, with more modules planned for development. Emeralx is currently in the beta version.

Installation

Before downloading the Emeralx library, you must ensure that Python is already installed on your computer, and the Python version should be above 3.7. Version 3.7 is only the minimum requirement, and some advanced functions may not be available when using it. Once you have installed Python, you can use the following command to install the Emeralx library from the command line.

pip install emeralx

After installing the Emeralx library, you can use the following command to ensure that the library was installed successfully.

pip list

If the Python library ‘Emeralx’ appears in the list, it means you have successfully installed it.

Help

Our documentation is actively being written. To view the basic help documentation, please write the following code in your Python program.

import emeralx
help(emeralx)

Quick Start

· Basic framework:

import emeralx

window=emeralx.display.Window() # Create a window object.

room=emeralx.display.Room(window) # Create a room on the window.
room.set_caption("NewGame") # Set caption for the room, which will show on title bar.
room.switch() # Switch to the window.

window.listen() # Window Mainloop.

· Create a Animation of sprite and show it on window

import emeralx

window=emeralx.display.Window() # Create a window.

room=emeralx.display.Room(window) # Create a room.
room.switch()

img=emeralx.image.Animation(path="xxx.gif")
sp=emeralx.entity.Sprite(room,img,position=(0,0)) # Create a sprite object.

emeralx.events.When(window,emeralx.events.EACH_FRAME_STEP()).do(lambda:sp.next_texture()) # Change to next texture.

window.listen() # Mainloop.

· Draw a text on the window

import emeralx

window=emeralx.display.Window() # Create a window.

room=emeralx.display.Room(window) # Create a room.
room.switch()

text=emeralx.canvas.Text("Hello World!",(0,0))
room.place(text) # Put the text on the room and display on window.

window.listen() # Mainloop.

Changelog

· 0.8.0 beta version : Develop the four main Python packages and have the ability to create basic games.

· 0.8.2 beta version : Fixed the bug that prevented packages from being imported.

· 0.8.5 beta version : Added some methods to the Sprite object, and added a Camera object to the display module.

· 0.9.1 beta version : Added the audio module and canvas module, and moved the window coordinate origin to the center.

License

MIT License - Check the LICENSE file for details.

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

emeralx-0.9.1.tar.gz (663.1 kB view details)

Uploaded Source

Built Distribution

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

emeralx-0.9.1-py3-none-any.whl (677.9 kB view details)

Uploaded Python 3

File details

Details for the file emeralx-0.9.1.tar.gz.

File metadata

  • Download URL: emeralx-0.9.1.tar.gz
  • Upload date:
  • Size: 663.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for emeralx-0.9.1.tar.gz
Algorithm Hash digest
SHA256 c5daf0c463b4a08b81e37686e198b858c3529d98a28f139226b1e76fc9bc8763
MD5 60c763e4ca05cfb714ac19de6af5e818
BLAKE2b-256 1e084357d26582461d1df6b7ea23ab8b9546590f5f65f3ad3256450c9c073e5a

See more details on using hashes here.

File details

Details for the file emeralx-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: emeralx-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 677.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for emeralx-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00a71c508a4319f75dfb15cd38c5efe7763312ea8c7a57fd0a6c81fd42124e20
MD5 041f6ddedf30d8f0d0bea0136d19f33a
BLAKE2b-256 6c64aae3fe577643da7a48cfbf96221d19a9282f89fa0d4ed4059941cea41e9e

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