Package: phoenyx
Phoenyx - Pygame Engine v0.3.3Some simple classes inpythonthat could make your life much easier. Relies on pygame, numpy and pymunk, based on the idea of the Processing language.Get the latest stable version using pip withpip install phoenyx.What it doesHow to ?RequirementsLicensesChangelogTODOsWhat it doesThis library allows you to create graphical components inpygamein a very few lines of code. It handles all color management, stroke weights and filling for you. It also provides a Vector and a SandBox wrapper class forpymunksuitable for physics engines and more mathematical drawings.Please go and checkpygameandpymunkfor their amazing work ! additional kudos to Daniel Shiffman.How to ?Please refer to theexamples folderon GitHub for very simple but effective test files. You can now also read thehelpmefile for all available methods and objects.fromphoenyximport*importrandomasrdrenderer:Renderer=Renderer(600,600,"collision")sandbox:SandBox=SandBox(renderer)count=0fall=Truedefrevert()->None:globalfallfall=notfalldefclear()->None:sandbox.clear()init()definit()->None:foriinrange(11):forjinrange(6):sandbox.add_ball(60*i+30*(j%2),100+60*j,1,15,elasticity=.99,is_static=True)sandbox.add_segment((0,600),(600,600),1,5,is_static=True)foriinrange(11):sandbox.add_segment((60*i,600),(60*i,500),1,5,is_static=True)defsetup()->None:globalfallinit()renderer.create_menu("options",toggle=revert,clear=clear)renderer.set_background(51)renderer.text_size=15defdraw()->None:globalcount,fallsandbox.step(iter=1)sandbox.draw()renderer.text(10,10,f"fps :{round(renderer.fps)}")count+=1ifcount>=30:count=0iffall:sandbox.add_ball(rd.randint(299,301),0,1,10,elasticity=.8)if__name__=="__main__":renderer.run()RequirementsObviously some distribution of python :python 3.9or above is required.You will also needpygamein order to use the Renderer,numpyto use Vectors math andpymunkto enable physics. To upgrade to a more recent version of any lib, runpip install --upgrade .... Requirements will automatically be met with pip when installing phoenyx.LicensesPhoenyx is licensed under the GPLv3. SeeLICENSEfor more details. Phoenyx also includes the following components from other open source projects (seeLICENSES folderfor more) :numpylicensed under the BSD 3-Clause "New" or "Revised" Licensepygamelicensed under the GNU LGPL version 2.1 Licensepymunklicensed under the MIT LicenseChangelogPlease refer tothe changelog filefor the full history.Migrating to the pymunk library for better physics (and complete support of chapes, joints and constraints). Circles, Segments and Polygons have been implemented (either dynamic or static ones). Pin joints, slide joints and segment extension have followed. Some fixes have been added to the Renderer as well as support for images manipulation.v0.3.3: do a barrel roll (click to expand)you can get rid of a SandBox shape if you want tonew methods for the Renderer to handle images and font changesnew ScrollBar thing (typehelp(phoenyx.ScrollBar)to learn more)ScrollBar affects the Renderer view field of the main windowactual animation for the ScrollBar itemhuge typo and format fix accross the entire repo (pray for the reorganisation)somehow reorganisation worked around pymunk errors when closing main windownew method to handle the Renderer pixel arraynew example file, water ripple (f slow)finally worked around slicing vectors, functionnal getitem setitem delitem methodsnew methods for the Renderer to draw anti-aliased linesTODOsoption to hide buttons and sliders or to draw them only when neededoption of alts drawing methods for buttonskeyboard integrationscrollbars and side menusinterractive drawingphysics Sandboxmore physics happening for bodiesforms and confirm boxes, eventsintegrate some utility functions (based on the example files)2d game oriented approach, player, compas, cells, map, ...get rid of the renderer and sandbox objects and bring all methods into main scope (not guaranteed)if, big if, there is a v2, 3D rendering