Skip to content

A playground for 2d Physics made with openCV and box2d (and a splash of (pySimpleGui)

Notifications You must be signed in to change notification settings

lewis-morris/physicsSandbox

Repository files navigation

Example

What am I?

Physics sandbox is what it says on the tin. Its a 2D physics sandbox game creator based solely on pybox2d (box2D) and opencv with a dash of numpy and pysimplegui (theres no pygame, all the rendering is written from scratch).

You can create any realistic simulations and game scenarios of your choosing. Think of it as a of Gary's Mod. But not as good and only in 2D.

Why?

Its all come from stumbling across pybox2d. And is just a project to see what I am capable of.

There are bugs. But it works pretty well, I've never studied game development and don't really know what I'm doing in that respect.

Its only tested fully in Linux (although all libraries used are cross platform, its not been tested on a mac)

What can I do?

I've managed to unfaithfully create a whole host of games which you can load.

Give them a go, and find out for your self.

(If you have an engineering degree I think you might make something more creative than me)

I dont know what I'm doing, help!!

Having an understanding of 2D game physics and box2D would help but there are tonnes of tutorials below, all video based.

Apologies if I'm not so clear and concise in the videos - theres a lot to cover and the best way to learn is to just try it for your self.

I suggest at minimum watching the first 3 tutorials, but you could get by and have fun with just the first one.

1 - Basic Usage (block creation)

2 - Joint Creation (joining blocks)

3 - Sensor Creation

4 - Playing Board

5 - Player Options

6 - Joint Options

7 - Moving Blocks (keyboard)

MAKING ANGRY BIRDS FROM SCRATCH

How do I try it out? (Installation Guide)

If you've got git installed its easy.

Just open a console or command prompt and navigate to a folder that you wish to install it in.

Then type

git clone http:https://www.github.com/lewis-morris/physicsSandbox
cd physicsSandbox
pip install -r requirements.txt
python run.py

What if I find a bug or want an enhancement?

I've put in so much time to this project its time to move on, but if you find a glaring bug or have a great idea. Let me know. I'm not adverse to improving things.

And if people enjoy it then why not make it better?

I've made a great level and I want to share it.

Submit a pull request and maybe I'll add it to the repo.

Contact me

If any one wants to contact me directly its [email protected]

Logo

About

A playground for 2d Physics made with openCV and box2d (and a splash of (pySimpleGui)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages