Skip to main content

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


Download files

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

Source Distribution

gemini-engine-1.0.3.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

gemini_engine-1.0.3-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

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