A monospace 2D ASCII rendering engine
Project description
Gemini Engine
Gemini Engine is a monospace 2D ASCII rendering engine. It includes collisions, layers, inputs and the ability to handle solid objects as well as ascii art. Examples can be found on the GeminiExamples github
WARNING: It’s important to use a monospace font in the terminal for the engine to render images properly
Quick start
Gemini Engine can be installed using pip:
python3 -m pip install -U gemini-engine
If you want to run the latest version of the code, you can install from github:
python3 -m pip install -U git+https://github.com/redpenguinyt/GeminiEngine.git@latest
Now that you have installed the library, instance a Scene and an Entity, then render the scene
from gemini import Scene, Entity
scene = Scene(size=(20,10))
entity = Entity(pos=(5,5), size=(2,1), parent=scene)
scene.render()
You should get something like this in your console:
Look at that! You just made your first Gemini project! Now try adding a while loop to the end of your code
from gemini import Scene, Entity, sleep
scene = Scene(size=(20,10))
entity = Entity(pos=(5,5), size=(2,1), parent=scene)
while True:
entity.move((1,0))
scene.render()
sleep(.1)
Now the entity should be moving across the screen! When the entity goes out of the screen's bounds it will loop back round to the other side.
Sprites
The code below will animate a car moving across the screen:
from gemini import Scene, Sprite, sleep
car_image = """
______
/|_||_\`.__
(¶¶¶_¶¶¶¶_¶_\\
=`-(_)--(_)-'
"""
scene = Scene((30,10), is_main_scene=True)
car = Sprite((5,5), car_image)
while True:
scene.render()
car.move(1,0)
sleep(.1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for gemini_engine-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1b15cb761cdedb1091b1e6983b5a85e24fa09afb8538aa661f92a015bf8fd96 |
|
MD5 | f99d815baf514d791c0bb1a85b68eb3c |
|
BLAKE2b-256 | 2703e8032cd09f52205fad724241749883efefd1ee9a9bc30484d236426c3696 |