collide_circle
A simple Pygame utility for detecting collisions between rectangles and circles.
📦 Installation
Install from PyPI (after publishing):
pip install collide_circle
#Or install locally (from source):
pip install .
#Usage
import pygame
from collide_circle import rect_collides_with_circle
# Example Pygame setup
rect = pygame.Rect(100, 100, 80, 60)
circle_center = (150, 120)
circle_radius = 40
if rect_collides_with_circle(rect, circle_center, circle_radius):
print("Collision detected!")
#Function
rect_collides_with_circle(rect, circle_center, circle_radius)
from collide_circle_package import circle_collides_with_circle
# Define two circles
circle1 = (100, 100, 30) # x, y, radius
circle2 = (130, 100, 20)
# Check for collision
if circle_collides_with_circle(*circle1, *circle2):
print("Circles are colliding!")
else:
print("Circles are not colliding.")
#function
circle_collides_with_circle(x1, y1, r1, x2, y2, r2) -> bool
Metadata
Release files for collide-circle 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| collide_circle-0.1.3.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| collide_circle-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.9 kB
Release files / collide_circle-0.1.3.tar.gz
| Download URL | collide_circle-0.1.3.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed6eaac834952fc4aac3b8a3e1e4a7543ffb1808b45e2f31ec59a6af32abd2a2
|
|
BLAKE2b-256 checksum How to use checksums |
cdff48840fa27e1281750c754fe3c3c438a48c5155ded233caa7dac915aa3144
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / collide_circle-0.1.3-py3-none-any.whl
| Download URL | collide_circle-0.1.3-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a41f49a0c9fa2104e273b329776fc0abceadc47846e0614c3fe5be1ab71fd50c
|
|
BLAKE2b-256 checksum How to use checksums |
278b476592a3e2004ede3cd6f6a28df8e38b320340fc7ca8137ce27d8a54e3bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|