Name | pygamelive JSON |
Version |
1.0.0
JSON |
| download |
home_page | |
Summary | Live coding in your pygame projects! |
upload_time | 2023-03-20 23:10:17 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.2 |
license | BSD Zero Clause License Copyright (c) [year] [fullname] Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
keywords |
python
pygame
livecoding
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# About
This module provides live coding in pygame.You can see your code changes at once without restart application.
https://user-images.githubusercontent.com/125838640/226334376-04f91f11-1775-49e5-8b04-2704e3355197.mp4
> **Note:** Your Game should be implemented OOP style
# Installing
>**pip install pygamelive**
# How to use?
## Step 1
Import PygameLive class from package.
```python
from pygamelive import debugger
```
## Step 2
Create instance of PygameLive class in your game class.
```python
def __init__(self):
pg.init()
self.screen = pg.display.set_mode(RES)
self.clock = pg.time.Clock()
self.load_assets()
self.sound = Sound()
self.score = Score(self)
self.fire = DoomFire(self)
self.new_game()
self.py_live = debugger.PygameLive()
```
## Step 3
Use **debug** method on your draw, update and check_event methods in your game loop.
```python
def run(self):
while True:
# self.check_events()
# self.draw()
# self.update()
#Live coding
self.py_live.debug(self.draw)
self.py_live.debug(self.update)
self.py_live.debug(self.check_events)
```
**Your code changes on the methods which you added using **self.py_live.debug(self.draw)** will be displayed immediately**
> **Note:** You can name your methods differently but the design of your game should be alike the design pattern noted below.
# Example Game
Example game (FlappyDooM) is made by Stanislav Petrov [StanislavPetrovV](https://github.com/StanislavPetrovV).
# Critical Info
You should design your game like this to work PygameLive properly(highly recommended to look up example folder):
```mermaid
graph LR
B(Game Object Renderer 1) --> C(Main Renderer)
D(Game Object Renderer 2) --> C(Main Renderer)
E(Game Object Renderer 3) --> C(Main Renderer)
```
> **Note:** Please look up example repo and change main.py file with the orginal one.
Raw data
{
"_id": null,
"home_page": "",
"name": "pygamelive",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.2",
"maintainer_email": "",
"keywords": "python,pygame,livecoding",
"author": "",
"author_email": "ElsevarAsadov <elseverclash57@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1a/d9/44592f593187f11c5d5f271a63855032999ec47872d735a57e03571b337f/pygamelive-1.0.0.tar.gz",
"platform": null,
"description": "\r\n# About\r\nThis module provides live coding in pygame.You can see your code changes at once without restart application.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/125838640/226334376-04f91f11-1775-49e5-8b04-2704e3355197.mp4\r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n> **Note:** Your Game should be implemented OOP style\r\n\r\n# Installing\r\n\r\n>**pip install pygamelive**\r\n\r\n\r\n# How to use?\r\n\r\n## Step 1\r\n\r\nImport PygameLive class from package.\r\n```python\r\nfrom pygamelive import debugger\r\n```\r\n\r\n## Step 2\r\n\r\nCreate instance of PygameLive class in your game class.\r\n```python\r\ndef __init__(self):\r\n pg.init()\r\n self.screen = pg.display.set_mode(RES)\r\n self.clock = pg.time.Clock()\r\n self.load_assets()\r\n self.sound = Sound()\r\n self.score = Score(self)\r\n self.fire = DoomFire(self)\r\n self.new_game()\r\n\r\n self.py_live = debugger.PygameLive()\r\n ```\r\n\r\n## Step 3\r\n\r\nUse **debug** method on your draw, update and check_event methods in your game loop.\r\n\r\n\r\n```python\r\ndef run(self):\r\n while True:\r\n # self.check_events()\r\n # self.draw()\r\n # self.update()\r\n #Live coding\r\n self.py_live.debug(self.draw)\r\n self.py_live.debug(self.update)\r\n self.py_live.debug(self.check_events)\r\n```\r\n\r\n\r\n**Your code changes on the methods which you added using **self.py_live.debug(self.draw)** will be displayed immediately**\r\n> **Note:** You can name your methods differently but the design of your game should be alike the design pattern noted below.\r\n\r\n\r\n# Example Game\r\n\r\nExample game (FlappyDooM) is made by Stanislav Petrov [StanislavPetrovV](https://github.com/StanislavPetrovV). \r\n\r\n# Critical Info\r\nYou should design your game like this to work PygameLive properly(highly recommended to look up example folder):\r\n\r\n```mermaid\r\ngraph LR\r\n\r\nB(Game Object Renderer 1) --> C(Main Renderer)\r\nD(Game Object Renderer 2) --> C(Main Renderer)\r\nE(Game Object Renderer 3) --> C(Main Renderer)\r\n```\r\n> **Note:** Please look up example repo and change main.py file with the orginal one.\r\n",
"bugtrack_url": null,
"license": "BSD Zero Clause License Copyright (c) [year] [fullname] Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.",
"summary": "Live coding in your pygame projects!",
"version": "1.0.0",
"split_keywords": [
"python",
"pygame",
"livecoding"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "06a1b3e9611d9417871ca109a9132d366b271e18cf56b967526b378709df0a98",
"md5": "7d619b59d7aac1c9317dfd63379aa200",
"sha256": "529860a05425630e390a17b76eb9d393867104abc416e0705e2b5edf193e7635"
},
"downloads": -1,
"filename": "pygamelive-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7d619b59d7aac1c9317dfd63379aa200",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.2",
"size": 4464,
"upload_time": "2023-03-20T23:10:15",
"upload_time_iso_8601": "2023-03-20T23:10:15.092954Z",
"url": "https://files.pythonhosted.org/packages/06/a1/b3e9611d9417871ca109a9132d366b271e18cf56b967526b378709df0a98/pygamelive-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1ad944592f593187f11c5d5f271a63855032999ec47872d735a57e03571b337f",
"md5": "8a346af415ca8b6c8078a149c2b6da30",
"sha256": "c6067941e9a50f356100bd7b5d32e605377bf6380733fc4b56652dd23dd0ee71"
},
"downloads": -1,
"filename": "pygamelive-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "8a346af415ca8b6c8078a149c2b6da30",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.2",
"size": 3872,
"upload_time": "2023-03-20T23:10:17",
"upload_time_iso_8601": "2023-03-20T23:10:17.010863Z",
"url": "https://files.pythonhosted.org/packages/1a/d9/44592f593187f11c5d5f271a63855032999ec47872d735a57e03571b337f/pygamelive-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-20 23:10:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "pygamelive"
}