{ "info": { "author": "John Reese", "author_email": "john@noswap.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries" ], "description": "cpgame\n======\n\nSimple \"game\" framework for [CircuitPython][] embedded hardware.\n\n\nOverview\n--------\n\ncpgame provides a number of decorators and a simple event loop to provide a responsive\nframework for building applications and games on embedded hardware using CircuitPython.\n\nRun a function on every \"tick\" of the event loop:\n\n```python\nfrom cpgame import start, tick\n\n@tick\ndef loop(now):\n ...\n\nstart()\n```\n\nBlink a Neopixel every second:\n\n```python\n@every(1)\ndef periodic(now):\n pixel[0] = RED if int(now) % 2 else OFF\n```\n\nTurn a Neopixel on and off with a button press:\n\n```python\n@on(board.BUTTON_A, DOWN)\ndef pressed(now):\n pixel[0] = RED\n\n@on(board.BUTTON_A, UP)\ndef released(now):\n pixel[0] = OFF\n```\n\nCreate or reset timers:\n\n```python\n@on(board.BUTTON_A)\ndef flood(now):\n pixels.fill(random.choice(COLORS))\n delay = random.randint(20, 100) / 10 # between 2 and 10 seconds\n after(delay, flood)\n\n@on(board.BUTTON_B)\ndef halt(now):\n cancel(flood)\n```\n\nPlay sound:\n\n```python\nenable_speaker()\nmiddle_a = sample(440)\n\n@on(board.BUTTON_A)\ndef noise(now):\n play_sound(middle_a, 1)\n```\n\n\nRoadmap\n-------\n\n* Support more boards than Circuit Playground Express.\n* Add helper functions for animating NeoPixels, raw audio clips, and LCD displays.\n\n\nLicense\n-------\n\naiosqlite is copyright [John Reese](https://jreese.sh), and licensed under the\nMIT license. I am providing code in this repository to you under an open source\nlicense. This is my personal repository; the license you receive to my code\nis from me and not from my employer. See the `LICENSE` file for details.\n\n[CircuitPython]: https://circuitpython.org", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jreese/cpgame", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cpgame", "package_url": "https://pypi.org/project/cpgame/", "platform": "", "project_url": "https://pypi.org/project/cpgame/", "project_urls": { "Homepage": "https://github.com/jreese/cpgame" }, "release_url": "https://pypi.org/project/cpgame/0.5/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Simple game framework for CircuitPython embedded hardware", "version": "0.5" }, "last_serial": 4928678, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "04740e5a2c1c25c4b06710446760269d", "sha256": "7eef8deb3122073d422a5c6c705c28109b822ddf487617ce373bac2ca27ad6f9" }, "downloads": -1, "filename": "cpgame-0.5.tar.gz", "has_sig": false, "md5_digest": "04740e5a2c1c25c4b06710446760269d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4286, "upload_time": "2019-03-12T06:34:02", "url": "https://files.pythonhosted.org/packages/1a/77/0cedda9c5c503b88c90d0f8dd62c9689cbaeff52919f7e610aa8013129f7/cpgame-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04740e5a2c1c25c4b06710446760269d", "sha256": "7eef8deb3122073d422a5c6c705c28109b822ddf487617ce373bac2ca27ad6f9" }, "downloads": -1, "filename": "cpgame-0.5.tar.gz", "has_sig": false, "md5_digest": "04740e5a2c1c25c4b06710446760269d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4286, "upload_time": "2019-03-12T06:34:02", "url": "https://files.pythonhosted.org/packages/1a/77/0cedda9c5c503b88c90d0f8dd62c9689cbaeff52919f7e610aa8013129f7/cpgame-0.5.tar.gz" } ] }