Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redpenguinyt/gemini-py
A monospaced 2D ASCII rendering engine for Python
https://github.com/redpenguinyt/gemini-py
ascii ascii-animation ascii-art ascii-game game-dev game-development game-engine gemini-engine python python3
Last synced: about 1 month ago
JSON representation
A monospaced 2D ASCII rendering engine for Python
- Host: GitHub
- URL: https://github.com/redpenguinyt/gemini-py
- Owner: redpenguinyt
- License: mit
- Archived: true
- Created: 2022-05-09T12:18:02.000Z (over 2 years ago)
- Default Branch: stable
- Last Pushed: 2023-11-08T14:32:46.000Z (12 months ago)
- Last Synced: 2024-07-02T09:28:51.091Z (4 months ago)
- Topics: ascii, ascii-animation, ascii-art, ascii-game, game-dev, game-development, game-engine, gemini-engine, python, python3
- Language: Python
- Homepage: https://pypi.org/project/gemini-engine/
- Size: 157 KB
- Stars: 35
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Gemini Engine
[![PyPI version](https://img.shields.io/pypi/v/gemini-engine?logo=pypi)](https://pypi.org/project/gemini-engine)
![Stars](https://img.shields.io/github/stars/redpenguinyt/GeminiEngine?color=yellow) ![Last commit](https://img.shields.io/github/last-commit/redpenguinyt/geminiengine) ![Code size](https://img.shields.io/github/languages/code-size/redpenguinyt/GeminiEngine) [![Downloads](https://img.shields.io/pypi/dm/gemini-engine)](https://pypi.org/project/gemini-engine) [![Issues](https://img.shields.io/github/issues/redpenguinyt/geminiengine)](https://github.com/redpenguinyt/GeminiEngine/issues)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](https://github.com/redpenguinyt/GeminiExamples)
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
```py
from gemini import Scene, Entityscene = 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:
![Gemini example 1](https://i.imgur.com/57daGVq.png)Look at that! You just made your first Gemini project! Now try adding a while loop to the end of your code
```py
from gemini import Scene, Entity, sleepscene = 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:
```py
from gemini import Scene, Sprite, sleepcar_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)
```