when you first posted about this game a couple months ago, I had a lot of fun trying out the version Maverick1912 came up with. I also watched a couple videos about Blockudoku and was impressed with how fast it calculated valid moves, and removed completed lines and squares.
I was curious if C2 could match that speed, so when you asked again about showing the shadow I decided to give it a try... I started from scratch and used every thing I could think of to optimize how it calculates, and I am very happy with how well it turned out.
as it spawns each piece, it knows how wide and how tall the piece is and uses that info to reduce the number of checks it takes to see if there are possible moves. Each block in each piece knows what position it came from in the PieceArray and uses that to reduce the number of checks it takes to test if the shadow should be shown. Each block placed on the board knows its x and y location, and what 9x9 square it is in, so checking for complete lines and squares is simply picking and comparing the pickedcount - no looping through arrays, or collision tests, etc.
After each piece is placed on the board, it has to check if there are any possible moves for the remaining pieces, and it shows in a text box at the bottom of the screen how many squares in the array it had to test to determine if a move is possible or if the game is over. Even on my old Iphone 5s it does this instantly in surprisingly few checks!
This game doesn't use any tweens, animations, no sound effects, doesn't keep score, or any of the other nice things Maverick did, but it is fast! I might add more, and put in comments to help make it clear what it is doing, but hopefully this helps.
https://www.rieperts.com/games/forum/Blockudoku.capx
Thanks AllanR you did it awesomely.... My all dreams with BlukSudoko are slowly comes to be true. I really happy to see the shadow effect, my fingers are dancing hahaha..
By the way i like your logic, you add some more twist in the game in just few lines...
Yeah Maverik as all times great, but you are also a Guru in Construct 2 i can say!
The way that you generate tiles is just outstanding and other awesome things with it, you automated the things in it. As we generate tiles manually...
Thanks that you give it a try and optimized its code i really appreciated your work and the time you give it and very specially a Shadow. From your code i will learn alot of things.
Note: Your explanation was very clear and transparent which makes it easy for anyone to implement it.
You are my mentor!
Now I'm thinking of leaving my code to your own code.
Thanks once again!