Tetris game table "collision issue" Arduino WS2812B

Hi all,

Got inspired and started to create a Arduino Tetris table ( Interactive LED Table for 50€ ) and went ahead and started by downloading all the code he provides.

The code is great but I didn't want a bluetooth controller and wanted a different layout. Once I figured out the controls, started testing, I am by no means good at this, my code is messy and I cant figure out some errors, so I poked around the code a lot, making it messier probably. I got Tetris *kind of working but stuck with a collision detection, if I enable it, when drawing the tetromino on the first line it will trigger a Game Over.

Can anyone help and explain or help me fix the code.

Once I complete the project I will add it to "Project hub" and Instructables.

Thanks in advance.
Rod

(Understand that I am missing most of the head of the sketch, I will upload all of it shortly, this will help diagnose the bugs)

tetris.h (11.9 KB)

Read three of the four locked posts at the top of this forum so that you can post properly.

Thanks @vaj4088 it helped me understand the forum better and hopefully will get really good at being part of the community.

I think I will have to post the whole code for the sketch and explain where I am having problems. I have spent about 1 week 3-4 hrs per day after work trying to figure out why I have the errors. I can understand the logic, it is just I think i do get confused as I did not write the code initially and probably I am not at the level where the person that shared the code is, so I don't understand why they did what they did and used some advanced expressions.

Hope some one can help.

Kind regards Rod