A 2-D engine for Python and pygame
This package is made to fast prototype your multimedia applications like games on pygame. Write clean and pragmatic design. It lets you focus on the game engine itself, so you don’t have to take care about several details like setting up the window, loading and checking data (images, sound, font, fx, music, resources names…). All you need to do is to put your resources into a specific data folder and use them in your game class ‘MyEngine()’.
You don’t need to reinvent the wheel, some repetitive parts of code (main loop, getting the delta time, closing the window, drawing text…) are already described and ready to use in the default engine.
from laylib import Environment from engine import Engine def main(): demo = Environment(800, 600, False, 'My game') demo.load_complete(Engine(), 'data', 'resources.res') demo.gInstance.main_loop() demo.destroy() if __name__ == "__main__": main()
$ pip install -r requirements.txt
Then install laylib:
$ pip install laylib
Or alternatively, you can just copy the “laylib” folder into the same directory as the Python program that uses it.
For usage see examples provided with laylib. For more details, all other parts of documentation are described in the source file.
- version 1.1.7 revision
- add demo4, rain demo
- add FPS control, now we can set fps with “self.fps” in the main engine to control frame rate.
- version 1.1.6 revision
- update demo1
- class Music in resources.py: add the function play() to control the music playlist and the volume
- update demo1 to integrate music play() function.
- all private methods prefixed with underscore
- one common data folder for test and demo, to reduce size.
- in Resources manager: the sound format .ogg is moved to Music class and removed from Sound ‘fx’ class.
- relative path to test_laylib changed
- variable self.all_sprites = pg.sprite.Group() set directly in the DefaultEngine class.
- add demo1 example to show how to manage resources with laylib
- updating test_laylib for the 1.1.5 version
- update documentation in the source files.
- Add Travis CI file
- bug fix rotate function util.py file
- changed value 3.14 to math.pi deg2rad function util.py
- add complete test module
- changed README.md to README.rst
- Bug version package fix (init.py file).
- Removed functions: load_global()/destroy_global() from Resources class.
- Bug version fix (setup.py file).
- Now we can set the ‘time_unit’ to change the delta_time unit.
- Minor bugs fix on util.py
- The first proper release
- Work in progress
Amardjia Amine â€“ firstname.lastname@example.org Distributed under the MIT license.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size laylib-1.1.8-py3-none-any.whl (11.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size laylib-1.1.8.tar.gz (11.0 kB)||File type Source||Python version None||Upload date||Hashes View|