This is the first python 2D-ANSI game engine rendering in the terminal. This library features the engine class itself, along with some utilitary classes for a more efficient use of it.
pip install flore1
- Interpret an easy syntax for creating text based sprites with color.
- Convert pictures to text based sprites.
- Manage picture's transparency.
- Create scenes with defined resolution, position and frame rate.
- Render sprites in a scene.
- Move sprites in a scene.
- Convert all the pictures in a directory to a flipbook.
- Display sprites with layers, transparency and depth management.
- Add custom functions to the game loop.
- Sync/unsync the looped functions with render speed (fps stabilisation).
- Play flibook in a scene at a desired frame rate.
- Input profiles for easy key customization
- Tell if one of the actions in the input profile has one of its corresponding key pressed.
alt_input()
Alternative toinput()
which is very customizable- Simultaneous keys / shortcut detection support
Gradually
Documentation and tutorialsGradually
Quality of life improvementsGradually
OptimizationHigh priority
Mouse handlerHigh priority
UI helper classesMedium priority
Basic server/client fonctionnalitiesLow priority
Sound managementLow priority
Remote SSH rendering
According to the latest tests:
fast
good rendering
Windows 10
CPU
- cmd.exefast
good rendering
Windows 10
CPU
- Powershellfast
bad rendering
Windows 10
GPU
- new terminalslow
good rendering
Linux
CPU
- repl.it terminal emulator
Notes:
- It has great probability of rendering well on any modern terminal which supports the following escapes codes:
"\033[<row>;<col>H"
"\33[0m"
"\u001b[49;5;<color_code>m"
"\u001b[39;5;<color_code>m"
- Terminals that do not support thoses will never be compatibles.
- Flore1 is not using ncurses
Prints 1
, test
and 3.14
2 times per second.
from flore1 import *
# Creating the Refresh instance
# and initializing its call frequency (fps)
refr = Refresh(fps=2)
# Function we want to be called
def example(arg1, arg2, arg3='something'):
print(arg1)
print(arg2)
print(arg3)
# asking to add the function to the calling queue
refr.feed(example, (1, 'test'), {'arg3':3.14})
# (function, *args, **kwargs)
# How example will be called then:
# example(1, 'test', 3.14)
# Repeatedly asking the Refresh Instance to
# check if it is time to call all the function
# in its calling queue.
while True:
refr.run()
Flore1 only features documentation with Google-style docstrings in the code. Markdown documentation is coming soon.
- flore1-paint An open source paint software for drawing and animating flore1 TextAssets
This library is distributed under a CC-BY-SA license:
- You can:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.