Name | dpongpy JSON |
Version |
1.0.1
JSON |
| download |
home_page | None |
Summary | Didactical implementation of PONG as an online multiplayer game, aimed at exemplifying distributed systems |
upload_time | 2024-10-29 11:01:24 |
maintainer | None |
docs_url | None |
author | Giovanni Ciatto |
requires_python | <4.0.0,>=3.10.0 |
license | Apache 2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DPongPy
Didactical implementation of PONG as an online multiplayer game, aimed at exemplifying distributed systems.
## Relevant features
- Supports offline game (1-4 players, no AI)
- No points, no winner, just 1-4 paddles and a ball
- Supports online game (1-4 players, no AI) via UDP
## How to install
```bash
pip install dpongpy
```
## How to play
Run `python -m dpongpy --help` to see the available options.
Two modes are available:
- `local` for playing offline (all players sharing the same keyboard)
- `centralised` for online (all players connecting to a central server)
When in `centralised` mode, the server must be started first, and the clients must _connect_ to it.
In this case, the server is called `coordinator`, and the clients are called `terminal`s.
You should start the coordinator first, and then the terminals.
The `coordinator` instance of `dpongpy` shall keep track of the game state and update it according to the inputs coming from the `terminal` instances.
When a `coordinator` is started, no window is shown, yet logs may be printed on the console.
When a `terminal` is started, a window is shown, and the game can be played (provided that the `coordinator` is running).
Terminals may observe that the ball is reset to the central position whenever a player joins or leaves the game.
When in `local` mode, the game will include, by default, 2 paddles and the ball.
Users may specify which and how many paddles to include in their game via the `--size` option (`-s`).
After the `--side` option, you shall specify the side of the paddle (i.e. `left`, `right`, `up`, or `down`).
You should also specify which key mappings to use for each paddle, via the `--keys` option (`-k`).
Available key mappings are `wasd`, `ijkl`, `arrows`, and `numpad`.
You should specify the key mapping for each paddle, in the order they were specified via the `--side` option.
Therefore, default options are: `-s left -k wasd -s right -k arrows`.
When in `centralised` mode, it is up to `terminal`s to choose their paddle and the corresponding key mapping.
This is done, once again, via the `--side` and `--keys` options.
In this case, however, there is no default choice, and the user __must__ specify the side and key mapping of the paddle they want to control.
## Project structure
Overview:
```bash
<root directory>
├── CHANGELOG.md # Changelog for the last stable release
├── dpongpy # Main package
│ ├── __init__.py # Main module: here we implement the game loop business logic for the local game
│ ├── __main__.py # Main module's entry point: this is where argument parsing occurs
│ ├── log.py # Logging utilities
│ ├── model.py # Model module: here we define classes for Pong-related domain entities (paddle, ball, game)
│ ├── controller # Controller package
│ │ ├── __init__.py # Controller module: here we define interfaces for input and event handlers
│ │ └── local.py # Local controller module: here we implement the afore mentioned interfaces in a non-distributed way
│ ├── view.py # View module: here we define the game rendering logic
│ └── remote # Remote package
│ ├── __init__.py # Remote module: here we define interfaces for remote communication (client, server, address) in a protocol-agnostic way
│ ├── udp.py # UDP module: here we implement the afore mentioned interfaces in a UDP-specific way
│ ├── presentation.py # Presentation module: facilities for (de)serializing Pong-related domain entities
│ └── centralised # Centralised package
│ └── __init__.py # Centralised module: here we re-define the game loop business logic to work as either centralised server or a terminal client
├── LICENSE # License file
├── package.json # NPM package file (for semantic-release)
├── package-lock.json # NPM package lock file (for semantic-release)
├── poetry.lock # Poetry lock file for fixing Python dependencies
├── poetry.toml # Poetry configuration file
├── pyproject.toml # Project metadata definition, compliant to the Poetry standard
├── README.md
├── release.config.js # semantic-release configuration file (for release on PyPI)
├── renovate.json # Renovate configuration file (for automatic dependency updates)
├── requirements.txt # Use this to automatically install Poetry dependencies, then run `poetry install` to actually install the project dependencies
└── tests # Unit tests of the project: the file names are self-explanatory
├── test_model.py
├── test_presentation.py
└── test_udp.py
```
Raw data
{
"_id": null,
"home_page": null,
"name": "dpongpy",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>=3.10.0",
"maintainer_email": null,
"keywords": null,
"author": "Giovanni Ciatto",
"author_email": "giovanni.ciatto@unibo.it",
"download_url": "https://files.pythonhosted.org/packages/b5/58/933293e5a3615caa50f82ed498bb5bffd4c6a2d268208d0ee37f321c5a3c/dpongpy-1.0.1.tar.gz",
"platform": null,
"description": "# DPongPy\n\nDidactical implementation of PONG as an online multiplayer game, aimed at exemplifying distributed systems.\n\n## Relevant features\n\n- Supports offline game (1-4 players, no AI)\n- No points, no winner, just 1-4 paddles and a ball\n- Supports online game (1-4 players, no AI) via UDP\n\n## How to install\n\n```bash\npip install dpongpy\n```\n\n## How to play\n\nRun `python -m dpongpy --help` to see the available options.\n\nTwo modes are available: \n- `local` for playing offline (all players sharing the same keyboard) \n- `centralised` for online (all players connecting to a central server)\n\nWhen in `centralised` mode, the server must be started first, and the clients must _connect_ to it.\nIn this case, the server is called `coordinator`, and the clients are called `terminal`s.\nYou should start the coordinator first, and then the terminals.\nThe `coordinator` instance of `dpongpy` shall keep track of the game state and update it according to the inputs coming from the `terminal` instances.\nWhen a `coordinator` is started, no window is shown, yet logs may be printed on the console.\nWhen a `terminal` is started, a window is shown, and the game can be played (provided that the `coordinator` is running).\nTerminals may observe that the ball is reset to the central position whenever a player joins or leaves the game.\n\nWhen in `local` mode, the game will include, by default, 2 paddles and the ball.\nUsers may specify which and how many paddles to include in their game via the `--size` option (`-s`).\nAfter the `--side` option, you shall specify the side of the paddle (i.e. `left`, `right`, `up`, or `down`).\nYou should also specify which key mappings to use for each paddle, via the `--keys` option (`-k`).\nAvailable key mappings are `wasd`, `ijkl`, `arrows`, and `numpad`.\nYou should specify the key mapping for each paddle, in the order they were specified via the `--side` option.\nTherefore, default options are: `-s left -k wasd -s right -k arrows`.\n\nWhen in `centralised` mode, it is up to `terminal`s to choose their paddle and the corresponding key mapping.\nThis is done, once again, via the `--side` and `--keys` options.\nIn this case, however, there is no default choice, and the user __must__ specify the side and key mapping of the paddle they want to control.\n\n\n## Project structure\n\nOverview:\n```bash\n<root directory>\n\u251c\u2500\u2500 CHANGELOG.md # Changelog for the last stable release\n\u251c\u2500\u2500 dpongpy # Main package\n\u2502 \u251c\u2500\u2500 __init__.py # Main module: here we implement the game loop business logic for the local game\n\u2502 \u251c\u2500\u2500 __main__.py # Main module's entry point: this is where argument parsing occurs\n\u2502 \u251c\u2500\u2500 log.py # Logging utilities\n\u2502 \u251c\u2500\u2500 model.py # Model module: here we define classes for Pong-related domain entities (paddle, ball, game)\n\u2502 \u251c\u2500\u2500 controller # Controller package\n\u2502 \u2502 \u251c\u2500\u2500 __init__.py # Controller module: here we define interfaces for input and event handlers\n\u2502 \u2502 \u2514\u2500\u2500 local.py # Local controller module: here we implement the afore mentioned interfaces in a non-distributed way\n\u2502 \u251c\u2500\u2500 view.py # View module: here we define the game rendering logic\n\u2502 \u2514\u2500\u2500 remote # Remote package\n\u2502 \u251c\u2500\u2500 __init__.py # Remote module: here we define interfaces for remote communication (client, server, address) in a protocol-agnostic way\n\u2502 \u251c\u2500\u2500 udp.py # UDP module: here we implement the afore mentioned interfaces in a UDP-specific way\n\u2502 \u251c\u2500\u2500 presentation.py # Presentation module: facilities for (de)serializing Pong-related domain entities\n\u2502 \u2514\u2500\u2500 centralised # Centralised package\n\u2502 \u2514\u2500\u2500 __init__.py # Centralised module: here we re-define the game loop business logic to work as either centralised server or a terminal client\n\u251c\u2500\u2500 LICENSE # License file\n\u251c\u2500\u2500 package.json # NPM package file (for semantic-release)\n\u251c\u2500\u2500 package-lock.json # NPM package lock file (for semantic-release)\n\u251c\u2500\u2500 poetry.lock # Poetry lock file for fixing Python dependencies\n\u251c\u2500\u2500 poetry.toml # Poetry configuration file\n\u251c\u2500\u2500 pyproject.toml # Project metadata definition, compliant to the Poetry standard\n\u251c\u2500\u2500 README.md \n\u251c\u2500\u2500 release.config.js # semantic-release configuration file (for release on PyPI)\n\u251c\u2500\u2500 renovate.json # Renovate configuration file (for automatic dependency updates)\n\u251c\u2500\u2500 requirements.txt # Use this to automatically install Poetry dependencies, then run `poetry install` to actually install the project dependencies\n\u2514\u2500\u2500 tests # Unit tests of the project: the file names are self-explanatory\n \u251c\u2500\u2500 test_model.py\n \u251c\u2500\u2500 test_presentation.py\n \u2514\u2500\u2500 test_udp.py\n```\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Didactical implementation of PONG as an online multiplayer game, aimed at exemplifying distributed systems",
"version": "1.0.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "18684e3be95a7fa5a416e3251a358b7093270174a6db1c8864f8acc8b24539fb",
"md5": "f8830810c759506e8720c2eb9d1e1589",
"sha256": "0f07bfeeece5e948adaf1f4ca03f96b45a1001cb90ae0a06cd547b5f6050e20d"
},
"downloads": -1,
"filename": "dpongpy-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8830810c759506e8720c2eb9d1e1589",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>=3.10.0",
"size": 23119,
"upload_time": "2024-10-29T11:01:23",
"upload_time_iso_8601": "2024-10-29T11:01:23.126485Z",
"url": "https://files.pythonhosted.org/packages/18/68/4e3be95a7fa5a416e3251a358b7093270174a6db1c8864f8acc8b24539fb/dpongpy-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b558933293e5a3615caa50f82ed498bb5bffd4c6a2d268208d0ee37f321c5a3c",
"md5": "3edae5d69c693aa02d02cdef7cf9bde7",
"sha256": "25f1fdb9573770977a7aaf3589bac28c92170545c83cbc30c180a7d976b44f78"
},
"downloads": -1,
"filename": "dpongpy-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "3edae5d69c693aa02d02cdef7cf9bde7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>=3.10.0",
"size": 21122,
"upload_time": "2024-10-29T11:01:24",
"upload_time_iso_8601": "2024-10-29T11:01:24.699632Z",
"url": "https://files.pythonhosted.org/packages/b5/58/933293e5a3615caa50f82ed498bb5bffd4c6a2d268208d0ee37f321c5a3c/dpongpy-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-29 11:01:24",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dpongpy"
}