Player package for your pygame game
Project description
pplayer
pplayer is a simple, flexible, and lightweight player controller package built for Pygame games.
It provides a plug-and-play Player class with support for sprite animations, gravity, collision detection, and shape-based drawing.
📦 Installation
pip install pplayer
If you encounter issues during installation, make sure you have pygame installed:
bash
Copy
Edit
pip install pygame
🚀 Features
Movement with A/D or Arrow keys
Jumping with W or UP key
Gravity and ground detection
Basic rectangle collision with tiles
Sprite animation support
Optional shapes: square, circle, or custom image
🧪 Usage
python
Copy
Edit
import pygame
from pplayer import Player
pygame.init()
screen = pygame.display.set_mode((640, 480))
clock = pygame.time.Clock()
tiles = [pygame.Rect(100, 400, 300, 50)]
player = Player(x=100, y=300, speed=5)
running = True
while running:
keys = pygame.key.get_pressed()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
player.update(keys, tiles)
screen.fill((30, 30, 30))
player.draw(screen)
for tile in tiles:
pygame.draw.rect(screen, (100, 100, 100), tile)
pygame.display.flip()
clock.tick(60)
pygame.quit()
🎮 Customization
python
Copy
Edit
Player(
x=100,
y=300,
speed=5,
images=[pygame.image.load("frame1.png"), pygame.image.load("frame2.png")],
shape="sprite", # or "circle", "square"
size=32,
color=(255, 0, 0)
)
📚 Project Links
PyLI package page
GitHub repository ← (Update with your actual repo URL)
Documentation
🔧 Development
For local development or contribution:
bash
Copy
Edit
pip install -e .
yaml
Copy
Edit
---
**Note:**
- Replace all `example.com` URLs with your actual PyLI page and docs links.
- Keep the style consistent and simple for PyLI’s parser and users.
If you want, I can help you generate a minimal `setup.py` or `pyproject.toml` file compatible with PyLI packaging too! Would you like that?
You said:
can you give me all in readme.md
ChatGPT said:
Absolutely! Here is the complete, clean, and well-formatted README.md ready for your pplayer package on PyLI:
markdown
Copy
Edit
# pplayer
**pplayer** is a simple, flexible, and lightweight player controller package built for Pygame games.
It provides a plug-and-play `Player` class with support for sprite animations, gravity, collision detection, and shape-based drawing.
---
## 📦 Installation
```bash
pip install pplayer
If you encounter issues during installation, make sure you have pygame installed:
bash
Copy
Edit
pip install pygame
🚀 Features
Movement with A/D or Arrow keys
Jumping with W or UP key
Gravity and ground detection
Basic rectangle collision with tiles
Sprite animation support
Optional shapes: square, circle, or custom image
🧪 Usage
python
Copy
Edit
import pygame
from pplayer import Player
pygame.init()
screen = pygame.display.set_mode((640, 480))
clock = pygame.time.Clock()
tiles = [pygame.Rect(100, 400, 300, 50)]
player = Player(x=100, y=300, speed=5)
running = True
while running:
keys = pygame.key.get_pressed()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
player.update(keys, tiles)
screen.fill((30, 30, 30))
player.draw(screen)
for tile in tiles:
pygame.draw.rect(screen, (100, 100, 100), tile)
pygame.display.flip()
clock.tick(60)
pygame.quit()
🎮 Customization
python
Copy
Edit
Player(
x=100,
y=300,
speed=5,
images=[pygame.image.load("frame1.png"), pygame.image.load("frame2.png")],
shape="sprite", # or "circle", "square"
size=32,
color=(255, 0, 0)
)
📚 Project Links
PyLI package page
GitHub repository ← (Update with your actual repo URL)
Documentation
🔧 Development
For local development or contribution:
bash
Copy
Edit
pip install -e .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pplayer-0.1.1.tar.gz
(3.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pplayer-0.1.1.tar.gz.
File metadata
- Download URL: pplayer-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85b9482c779323b2c0738745d9bc3533bd65c177003d4b60a48b83cac2b95de8
|
|
| MD5 |
f579dc77f71f2ded92d0ee2c1b654e05
|
|
| BLAKE2b-256 |
a70e3ae7db5321f4f6b43d1eb44eae2d200d3d5fd977aae84f0ac67def9efa56
|
File details
Details for the file pplayer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pplayer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9051b689db30268e93ad7aaff50afcc85b1e3ab63d2560d044b9e7a8197fa264
|
|
| MD5 |
ca5e630d7d70e3f68664e457718052df
|
|
| BLAKE2b-256 |
52d7fda2dd0f106639c2e65dc42bb93b35c0cd622fe603aca759d02e57a85419
|