Code Monkey home page Code Monkey logo

pbj-sandbox's Introduction

PBJ Sandbox

A point-based jelly physics sandbox, with several tools to construct shapes and scenes.

You can check it out here.

Features

  • Undo/redo
  • Selection, copy/paste/delete
  • Dynamic audio that responds to the physics (must be enabled first)
  • Collidable windows
  • Rope tool
  • Ball tool
  • Glue tool
  • Precise connector tool
  • Ghost trails, slow motion, gravity, and other settings
  • Keyboard shortcuts to switch tools (and to use some tools without switching)
  • Touch support

Ways to Lose Data

This should be considered a toy. However, since this is a topic I care about, I like to think about ways users can lose data, and I've documented it here.

There's no save/load. And the clipboard is internal, so you can't use it as a workaround to save/load. Everything is lost if you close the tab.

Some things are not in the undo state, even though they affect the world:

  • browser window size,
  • in-app window positions and sizes,
  • simulation options like gravity

Furthermore, if the simulation is active, undo/redo is destructive, because the states will be replaced with ones further ahead in time, as you go back and forth. For example, if you throw a point, and undo, the redo state is the state at which you undid the throw, so if you redo, it will be in midair. Then it lands, and you undo and redo, and it's already landed in the redo state.

And some things don't create undo history, like dragging windows, so you can go for quite some time messing around without creating any undo states you can go back to.

Eventually I plan to create a system where none of these things are the case. I'm calling that system Mopaint for now, but it's very early, and not focused on physics at all โ€” yet. ๐Ÿ™‚

Help + TODO

See in-app Help and TODO windows accessible from the Options window.

License

WTFPL or CC0

Contributing

This is just a toy, so I'm happy growing it as organically as the structures you can create with it.

Feel free to send pull requests adding weird tools.

See Also

  • Skele2D, a newer project of mine, a point-based editor / game engine thing

  • verlet-js, a point based physics engine that can have more solid shapes (bodies) because it uses Verlet integration

  • os-gui.js, the windowing library I use for this project

pbj-sandbox's People

Contributors

1j01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pbj-sandbox's Issues

Shift key gets stuck?

I don't know if this happens due to alt+shift+tabbing between windows or what, but I've seen it a couple times get stuck thinking the Shift key is held when it's not, and having to press it to get it to stop.
This could be very confusing if you don't know all the things Shift triggers in this toy, which includes dragging a whole group instead of a single point (sort of freezing its rotation and relative position).
So yeah, idk if this can even be fixed, oh wait I could reset keys on blur, duh, that'll probably fix it โ€” well, it might help, idk what the problem really is. (it's generally good to figure that out!!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.