Metadata-Version: 2.1
Name: pyphy2D
Version: 2
Summary: A 2D Rigid Body Physics Engine.
Author: Krishiv Goel
Author-email: KrishivGoelXD@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygame

# PyPhy2D

## Description
PyPhy2D is a 2D Rigid Body Physics Engine designed to simulate physical interactions of objects in a two-dimensional space. It is easy to integrate and can be used for games, simulations, and educational purposes.

## Whats New In PyPhy2D Version 2?
PyPhy2D now comes with the simplicity of python and the blazing speeds of C.
With the help of the cython engine PyPhy2D can now use C for heavy computations for a smoother operation.
Through benchmarks PyPhy2D 2 comes out to be 10-20x faster than version 1.0.

## License
This project is licensed under the MIT License.

## Installation
Before installing PyPhy2D, ensure you have PyGame installed:

```sh
pip install pygame

```
or
```sh
pip install pygame-ce

```

## Example Project
```python
from pyphy import World, Body, Vector2
import pygame
import sys

WIDTH, HEIGHT = 900, 900
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))

physicsAccuracy = 1 # precision of the engine (directly hits the performance)

space = World(window=WINDOW, gravity=(0, 9.8), physicsAccuracy)

clock = pygame.time.Clock()
FPS = 60

testBody = Body.CreateCircleBody(radius=25, center=Vector2(100, 100), density=1.2, restitution=0.8, static=False)
space.AddBody(testBody)

while True:
    dt = clock.tick(FPS) / 1000

    space.step(dt)

    WINDOW.fill((0, 0, 0))
    space.Render()

    pygame.display.update()

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            sys.exit()
```
