This is just a fun little project you have to use your mouse to touch the appearing blocks. You can use the coding for your project.
credits for @nicemate Fixing for me