Physics Engine (Kinda)

Physics engine, still in progress.


So, all you have to do is the following.
Click and drag and then release to launch a box.
The longer you hold down the mouse, the more mass it has.
The phyiscs are all homebrew and pretty simple.
Please vote if you like it, and bananas are welcome payment.

Any questions? Ask!

You are viewing a single comment. View All

Aww, no collisions? That's where all the madness fun happens!


@fuzzyastrocat for circle's it's actually quite easy

correction: collisions with polygons, that's where all the fun begins :D


@realTronsi Well yes, circle collision detection is easy. But even with circles collision resolution is difficult.

So no, I keep my original statement.


@fuzzyastrocat actually since it's uniform on all sides you literally only have to account for 1 point at the bare minimum and run some physics depending on their velocities to determine how much they're offset. The actual direction isn't too difficult either (obviously comparing to irregular polygons) because you can use basic trigonometry to determine which direction the ball bounces, since there's only two variations of colliding up and colliding past, there aren't too many cases to consider, and you could hard code it if you want.



run some physics depending on their velocities to determine how much they're offset

This is the difficult part, because having multiple circles collide at once can get really glitchy.


@fuzzyastrocat It could be worse.

There could be no border collision.


@Arbiter1227 Heh, true.


@fuzzyastrocat well true, if implemented incorrect,ly, but we can prioritize the ball with the greater velocity, such that multiple colliding balls will just result in a domino effect where all balls are pushed away.


@realTronsi I do plan on fleshing out the physics once I have time, and the rects will become circles and then it will have collision. Maybe I will add angular velocity so that it could spin and stuff


@fuzzyastrocat Its actually probably really hard to:
1) Code that
2) Actually get the balls to hit each other cause they're so damn small


@XxMustardCatxX Of course it's hard, but it's not like anyone forced them to make a physics engine. It's not really a physics engine without collisions.

(Also the small thing isn't really an issue.)


@fuzzyastrocat Also, im putting the engine on hold as im working on a boid simulation (flocking behaviour)


@XxMustardCatxX and if the problem is them being small ill just increase the size/time ratio (basically holding down will increase the size faster)