Skip to content

A simple 2D simulation library using Pymunk and Pygames

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
License.txt
Notifications You must be signed in to change notification settings

iamBijoyKar/floating_hippo

Repository files navigation

logo

Floating Hippo

Floating Hippo is a simple, abstracted, and easy to use library for 2D simulations using Pymunk and Pygames. This is designed to make it easier to create simulations without worrying about the complexity of Pymunk and Pygames. Is is a good starting point for beginners who want to learn about physics simulations.

Note: This library is still in development and is not ready for use. We are looking for contributors to help us finish this project 🙂

Features 🚀

  • Simple: Floating Hippo is designed to be simple and easy to use.
  • Abstracted: Floating Hippo abstracts the complexity of Pymunk and Pygames to make it easier to create simulations.
  • Customizable: Floating Hippo allows you to customize the simulation as per your needs.
  • Event Handling: Floating Hippo provides an event handling system to handle events like mouse clicks, key presses, etc.
  • Built-in Shapes: Floating Hippo provides built-in shapes like circle, segment, and polygon to create the simulation.

Installation 🪄

pip install floating-hippo

Usage 📖

Simple example of a simulation dropping balls on a |_| shaped platform on mouse click using Floating Hippo.

Code 👇

from floating_hippo import Simulation

# Create a simulation
simulation = Simulation(800,600,caption="Test",gravity=(0,1000))

# Create a segment shape like |_|
simulation.create_segment((100,100),(100,500))
simulation.create_segment((100,500),(600,500))
simulation.create_segment((600,500),(600,100))

@simulation.events.add_event("mousebuttondown")
def on_click(event,*args,**kwargs):
    simulation.create_ball(event.pos)

falling_balls_floating_hippo - Made with Clipchamp

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing 🤝

Contributions, issues and feature requests are welcome! Feel free to check issues page.

Show your support ⭐️

Give a ⭐️ if this project helped you!