WLED
WLED copied to clipboard
reset usermod TetrisAI back to initial version
With this usermod TetrisAI compiles again.
fixes https://github.com/Aircoookie/WLED/issues/3888
As you are using static variables in your effect function: How does that scale up to playing Tetris on multiple segments?
So this basicially reverts some of the last commits of the usermod (please correct me if I misunderstood)?
Wouldn't it be smarter to resolve the compiler errors in the code, instead of stripping out things until it compiles?
OK I need to test if float is good enough for the AI part.
@muebau is there any interest in bringing this usermod up to speed and adjust code as requested or do we pull the plug and remove it from WLED? The code that does not compile is of no use and code that does not meet requirements cannot be included.
@muebau is there any interest in bringing this usermod up to speed and adjust code as requested or do we pull the plug and remove it from WLED? The code that does not compile is of no use and code that does not meet requirements cannot be included.
Well I will try to find time to fix at least the easy parts ( millis() ).
I am still not sure how to target the problem with the state:
static TetrisAIGame tetris(cols < 32 ? cols : 32, rows, 1, piecesData, numPieces);
I need an instance of TetrisAIGame for each segment, and it needs to be permanent. Every time the size of the segment (or other parameters) changes, I need to destroy the current instance and create a new one to be able to 'work' on the internal game grid.
I would appreciate suggestions from developers with more insight into WLED and C++.
I need to destroy the current instance and create a new one to be able to 'work' on the internal game grid
Do you really need to destroy it? It is just the two variables that change X and Y.
The other approach might be to just store relevant data in allocateData() buffer and use it as a POD.
Some other effects tackle this so take a look at other 2D effects.
I think this should fix the issues. What do you think?
Nice update... Tested on my 32x32 Matrix with 4 segments
Love to see it is working as it does here. 😂
BTW is this a WS2812 4X16X16 setup or something else?
BTW is this a WS2812 4X16X16 setup or something else?
Yes exactly this, with an added 3d printed grid and diffuser foil