{ "info": { "author": "Ricardo Band", "author_email": "email@ricardo.band", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: Games/Entertainment", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "![PyMLGame Logo][pymlgame_header]\n\nPyMLGame\n========\n\nPyMLGame is an abstraction layer to easily build games for Mate Light inspired by [PyGame][pygame].\n\nYou need 3 parts to actually have a running game on Mate Light.\n\ntl;dr\n-----\n\n```\nvirtualenv env\nsource env/bin/activate\npython setup.py install\n```\n\nThe game\n--------\n\nYou can build a game using the PyMLGame library. If you know the PyGame library this should be nothing new to you. Use the game_example.py to find out how to do so.\n\nA controller\n------------\n\nIf you want players, your game needs a controller to have some inputs. Controllers should work with every game made with PyMLGame. There is a controller_example.py to play with. An Android based controller app is available [here][pymlctlr].\n\nMate Light\n----------\n\nTo play PyMLGames you need the awesome Mate Light. You could use the one on [c-base space station][c-base], or build your own. If you're not near c-base and don't want to build your own, you can use the Mate Light emulator provided with PyMLGame.\n\n\nProtocol\n========\n\nThis is the protocol that handles the communication between the game and the controllers. It's very similar to OSC, as it sends slash seperated srings over UDP.\n\n\nController -> Game\n------------------\n\n### /controller/new/<port>\n\n - port: The port on the controller which the game should answer on.\n\nConnect a new controller to the game. Game will answer with /uid/<uid>. This is also known as 'anpymln'.\n\n### /controller/<uid>/ping/<port>\n\n - uid: The uuid given by the game to identify the controller.\n - port: The port on the controller which the game should answer on.\n\nTell the game that the controller is still in use and update it's address and port. Use this once every minute or the controller will be disconnected.\n\n### /controller/<uid>/kthxbye\n\n - uid: The uuid given by the game to identify the controller.\n\nDisconnect the controller properly. In theory you could just wait 60s but this is the cleaner way and most games would\nbe very happy if you use this.\n\n###/controller/<uid>/states/<states>\n\n - uid: The uuid given by the game to identify the controller.\n - states: A string of 14 numbers containing the states of every button of the controller.\n\nSend the states of your controller keys. Always send all 14 states, even if your controller doesn't have 14 buttons.\nThe states should be an array with 0 for key not pressed and 1 for key pressed. So if you're pressing the Up button and X button the states array should look like this: 10000010000000\nYou can lookup all possible buttons and there location in the array in [pymlgame/locals.py][locals.py].\n\n### /controller/<uid>/text/<text> *optional*\n\n - uid: The uuid given by the game to identify the controller.\n - text: String which should be send to the game.\n\nSend some text to the game. Maybe it asks you for a player name or the anser to a riddle. Games should always give you the option to enter text without this function but you can use it if your controller is capable of text input.\n\n\nGame -> Controller\n------------------\n\n### /uid/<uid>\n\n - uid: The uuid to identify the controller.\n\nTell the controller its uid. This is an UUID v4.\n\n### /rumble/<duration> *optional*\n\n - duration: Duration in milliseconds.\n\nTell the controller to rumble. Remember that not all controllers have the ability to vibrate. Maybe they do it in an visual or acoustic way.\n\n### /message/<text> *optional*\n\n - text: String to display.\n\nSend some text to the controller. Be aware that not all controllers can display text, so don't send things that are important for the game.\n\n### /download/<url> *optional*\n\n - url: URL to download.\n\nTell the controller to download the media file under the given url. The game can then ask the controller to play the\nfile so that the player can hear some ingame sounds. Use this function everytime the game starts because a controller\ncould have deleted the files after playing. Controllers should ensure that files already downloaded gets downloaded\nagain to reduce loading times for games that have been played before. Also games should try to have files with a unique name so that they don't get overwritten by other games. Don't call your file `sound.mp3`.\n\n### /play/<file> *optional*\n\n - file: Filename of the media file.\n\nTell the controller to play the file with that name. Use the download command to download media files to the controller before using this.\n\n\nTipps\n-----\n\nIf your controller downloads media files for games it is good practice to delete the downloaded stuff from time to time or give the user the ability to cleanup the downloaded files. The PyMLGame-Controller for Android will to this in a future release when you clean the apps data in the Apps view.\n\nIf your game uses some optional features, tell the players that they can have an even better gaming experience when they use a controller which is capable of these features.\n\n\n---\n\nHave fun while playing PyMLGames on Mate Light! :smiley:\n\n[pymlgame_header]: https://github.com/PyMLGame/pymlgame/raw/master/header.png \"PyMLGame\"\n[pygame]: http://pygame.org/\n[pymlctlr]: https://github.com/PyMLGame/pymlgame-controller\n[c-base]: https://c-base.org/\n[locals.py]: https://github.com/PyMLGame/pymlgame/blob/master/pymlgame/locals.py", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/PyMLGame/pymlgame/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/PyMLGame/pymlgame", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "PyMLGame", "package_url": "https://pypi.org/project/PyMLGame/", "platform": "any", "project_url": "https://pypi.org/project/PyMLGame/", "project_urls": { "Download": "https://github.com/PyMLGame/pymlgame/archive/master.zip", "Homepage": "http://github.com/PyMLGame/pymlgame" }, "release_url": "https://pypi.org/project/PyMLGame/0.3.3/", "requires_dist": null, "requires_python": null, "summary": "PyMLGame is an abstraction layer to easily build games for Mate Light inspired by PyGame.", "version": "0.3.3" }, "last_serial": 1880704, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "cd4cbdade207175ee91d214c2b47229d", "sha256": "beae964c3671868ecfba037de0b03fbe7a3b204fe94d033e4591d78b616e07d7" }, "downloads": -1, "filename": "PyMLGame-0.3.1.tar.gz", "has_sig": false, "md5_digest": "cd4cbdade207175ee91d214c2b47229d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7943, "upload_time": "2015-12-29T03:33:55", "url": "https://files.pythonhosted.org/packages/1e/14/6162c94be323e92c6d26687d03b33e32dd02f7a563154801430c7bf61e46/PyMLGame-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "f8e183dcb4681f07f50f87d187c27aec", "sha256": "bef0e2ccc87a1102e2989bd16015bc669d71e53d67dd0bed07678848627fca50" }, "downloads": -1, "filename": "PyMLGame-0.3.2.tar.gz", "has_sig": false, "md5_digest": "f8e183dcb4681f07f50f87d187c27aec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7945, "upload_time": "2015-12-29T03:36:36", "url": "https://files.pythonhosted.org/packages/6d/81/b53c7db0b4644f8bb06d376238f0fdc999eb4b303324b7ed1893e88bccb3/PyMLGame-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "45bf9e0d6519c15567409495493f3758", "sha256": "53072835634f399ec2feaa477d31fea0af92d95243c44cff9082db78cb28ef21" }, "downloads": -1, "filename": "PyMLGame-0.3.3.tar.gz", "has_sig": false, "md5_digest": "45bf9e0d6519c15567409495493f3758", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7960, "upload_time": "2015-12-29T03:40:42", "url": "https://files.pythonhosted.org/packages/6e/6b/fee5b09cde411fa4c8601d35bb1b14ddffca6ec7101e25e88bcde4ddb17c/PyMLGame-0.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "45bf9e0d6519c15567409495493f3758", "sha256": "53072835634f399ec2feaa477d31fea0af92d95243c44cff9082db78cb28ef21" }, "downloads": -1, "filename": "PyMLGame-0.3.3.tar.gz", "has_sig": false, "md5_digest": "45bf9e0d6519c15567409495493f3758", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7960, "upload_time": "2015-12-29T03:40:42", "url": "https://files.pythonhosted.org/packages/6e/6b/fee5b09cde411fa4c8601d35bb1b14ddffca6ec7101e25e88bcde4ddb17c/PyMLGame-0.3.3.tar.gz" } ] }