nice game! I'm on level 33 now.
thank you andymc
(not bad you have only 47 levels left
)
I did occasionally have issues where shaped don't snap into place straight away but I think that because they're overlapping another one.
correct, the grid is build of triangles and i calculate for every triangle his centroid (center point)
every 4 triangle are creating a square and i also get the 4 dots from the square corners so you have for every 4 triangles that are 1 square 4 dots and 4 centroids (1 for each triangle)
now the square dots are the snap points (i call them magnet points in my code) and i add a tolerance and for each shape vector - square dots vector if < the magnet tolerance (like 5%x) the shape will snape and the centroid of all triangle inside that polygon will be blocked. now when i move the other piece i check if a blocked triangle centroid is under that polygon if true then that polygon wont snap!
The rotating pieces levels sound really hard! Can't wait to get to those
the grid gets bigger and bigger (until 8x8) and then it became really hard. the rotation level starts at level 36 and they are really fun to play.
(i found yesterday a bug in the rotated levels and uploaded a new version so you better make sure you run v1.06 before getting to level 36)
the level select would be nice if it could be a grid based level select showing all the levels you have finished and the locked levels left to do, as in other mobile games.
i did it like this in the beginning but then i thought i will add much more levels to it and i wanted to save the time to change that panel that will contain all levels but i could create easily a loop for that that will do it automatically, so maybe i will add it in the next update.
btw you can click in the level selection on the level number and an input-dialog will open and you can just write down the level instead of tapping a lot the arrow buttons.
Ohh and if you would like to see how i make those levels here you go
(see the description of this video, i am making promotion for b4x.com
)
this level editor was created with the free development tool B4J
visit
www.b4x.com to download b4j for free !! (100% for free!)
check also my apps on
www.sagital.net