Tetris effect
The Tetris effect (also known as Tetris Syndrome) occurs when people devote so much time and attention to an activity that it begins to pattern their thoughts, mental images, and dreams. It takes its name from the video game Tetris.
People who played Tetris for a prolonged amount of time could find themselves thinking about ways different shapes in the real world can fit together, such as the boxes on a supermarket shelf, the buildings on a street, or hallucinating pieces being generated and falling into place on an invisible layout. In this sense, the Tetris effect is a form of habit. They might also dream about falling tetrominos when drifting off to sleep or see images of falling tetrominos at the edges of their visual fields or when they close their eyes. In this sense, the Tetris effect is a form of hypnagogic imagery.
Other examples
The Tetris effect can occur with other video games. It has also been known to occur with non-video games, such as the illusion of curved lines after doing a jigsaw puzzle, or the involuntary mental visualisation of Rubik's Cube algorithms common amongst speedcubers.