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. The main library is currently contained in the gemini folder, and everything outside is examples.
WARNING: Because of the way my code works, you HAVE to use a monospace font in the terminal
Quick start
To get started, 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 sleep
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.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f19d707e1653848a82c7b2765e1da5c37a03d7a9b87bad08e48227283308c32 |
|
MD5 | 9abd8dfb534714836be34237b53750ea |
|
BLAKE2b-256 | 6e1598dba41d6cd8911a306f7ea095c9bfb9246235b7f3f3d32b1cfc3b74a29c |