Package: laylib
laylib package for pygame.. image::https://img.shields.io/badge/License-MIT-yellow.svg:target:https://opensource.org/licenses/MIT.. image::https://img.shields.io/badge/version-1.1.9-red.svg:target:https://pypi.org/project/laylib.. image::https://travis-ci.org/Layto888/laylib.svg?branch=master:target:https://travis-ci.org/Layto888/laylibThis 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.Usage example :Template main file.. code-block:: pythonfrom laylib import Environment
from engine import Engine
import sys

def main():
demo = Environment(800, 600, False, 'My game')
demo.load_complete(Engine(), 'data')
demo.gInstance.main_loop()
demo.destroy()

if __name__ == "__main__":
sys.exit(main())Template engine file.. code-block:: pythonimport pygame as pg
from laylib import DefaultEngine

BLACK = (0, 0, 0)
FPS = 30.0


class Engine(DefaultEngine):
	""" Short summary.
	"""

	def __init__(self):
		super().__init__()
		self.setup()

	def update(self):
		""" Code to update all classes : 
		the global behavior should be written here.
		"""
		pass

	def draw(self):
		self.screen.fill(BLACK)
		""" Code to draw all classes
		"""
		pg.display.update()

	# init engine or set up environement

	def setup(self):
		self.playing = True
		# rescale in laylib time unit to 100.0 as example
		self.time_unit = 100.0
		self.fps = FPS
		"""
		rest of init code
		"""INSTALLATIONFirst, install the dependencies:Python3 (3.5 or later)http://www.python.orgPygame 1.9.1 or laterhttp://pygame.org/download.shtmlOr run in terminal:.. code-block:: bash$ pip install -r requirements.txtThen install laylib:.. code-block:: bash$ pip install laylibOr alternatively, you can just copy the "laylib" folder into the same
directory as the Python program that uses it.USAGEFor usage see examples provided with laylib.
For more details, all other parts of documentation are described in the source file.Release History1.1.9removed ressources.bin parameter1.1.8version 1.1.7 revisionadd demo4, rain demoadd FPS control, now we can set fps with "self.fps" in the main engine to control frame rate.1.1.7version 1.1.6 revisionupdate demo11.1.6class Music in resources.py: add the function play() to control the music playlist and the volumeupdate demo1 to integrate music play() function.all private methods prefixed with underscoreone common data folder for test and demo, to reduce size.1.1.5in Resources manager: the sound format .ogg is moved to Music class and removed from Sound 'fx' class.relative path to test_laylib changedvariable self.all_sprites = pg.sprite.Group() set directly in the DefaultEngine class.add demo1 example to show how to manage resources with laylibupdating test_laylib for the 1.1.5 versionupdate documentation in the source files.1.1.4Add Travis CI filebug fix rotate function util.py filechanged value 3.14 to math.pi deg2rad function util.pyadd complete test modulechanged README.md to README.rst1.1.3Bug version package fix (init.py file).1.1.2Removed functions:load_global()/destroy_global()from Resources class.Bug version fix (setup.py file).1.1.1Now we can set the 'time_unit' to change the delta_time unit.Minor bugs fix on util.py0.1.0The first proper release0.0.1Work in progressMetaAmardjia Amine â€“amardjia.amine@gmail.comDistributed under the MIT license.