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",
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** 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.
---
```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",
size=32,
color=(255, 0, 0)
)
📚 Project Links
PyLI package page
https://github.com/AynuDaDev/pplayer
Documentation
🔧 Development
For local development or contribution use:
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.2.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.2.tar.gz.
File metadata
- Download URL: pplayer-0.1.2.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 |
b73423ccf48f09dae5f1fa7cbb9c749c5c308280504d66250227569d94d121ea
|
|
| MD5 |
c53fd3ac20ab51f8b738c63c5c535732
|
|
| BLAKE2b-256 |
f1b2c7c2ee610262a88453a663809f9ef94a75aa9ece8eba0c2470023c70220e
|
File details
Details for the file pplayer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pplayer-0.1.2-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 |
f75fe42fb5e8b5ea981b56ee953f56517d1c6e740cfa2bf53145ff68fedf9686
|
|
| MD5 |
d80a610b3c0b1ba6f58fc14f16cd4622
|
|
| BLAKE2b-256 |
d9aa18495537d930d5f86751a4d6a1244db76ee4f2b4555c2788d6c892c68eb9
|