This is an attempt to rewrite the bricks game, this time adding the rotating bricks.
The problem with the rotating bricks is that I want a method to detect continuous collisions, but it is quite difficult to do it properly. And the most of the engines publicly available just use discrete methods to approximate the situation, which from my point of view is not satisfactory enough.
This is currently at very early stage. Don't expect anything playable for the present.
If someone wants to help test this project, then first clone this repository and then try
out the functions game.gjk
, game.collision.continuous
, and game.collision.statics
,
with the bricks in the game stored in the array game.objects
.
For convenience, the command to clone a single branch is:
git clone -b numerical-root-finding --single-branch https://github.com/JSDurand/rewrite_bricks
After cloning, one can open the file index.html
in a browser and try out the functions in the console.
Since this only uses an external library for drawing, a lot of basic functions are not optimised, e.g. the matrix operations, vector manipulations, etc. We might use the glMatrix library to improve the performance for example.
Also my own implementation of the GJK algorithm is possibly not very well-written, so that is a possible cause of bad performance, if it occurs.
I use the library p5 for drawing.
Thanks to everyone's support. :-)