Well the standard ML rubric for this sort of thing (i.e., creating a bot to play a video game) is Reinforcement Learning. This is a broad field comprised of a number of different techniques/algorithms; perhaps the one more relevant for your project is Q-Learning.
One of the standard treatises in Reinforcement Learning is Reinforcement Learning: An Introduction, by Richard Sutton and Andrew Barto. The link just supplied takes you to the book's homepage, which includes links to public access online versions of the book, as well as links to free pdf versions.
Here a demo on YouTube showing an RL-based bot that has learned to play Ms. PacMan.
The blog Mechanistician has a complete tutorial for building a PackMan playing bot using Reinforcement Learning (in the python language). I suppose this is certain an excellent place to begin.
I would also consider installing a good RL library in your language of choice. Look at the source code and experiment with the library's API. In Python there are (at least) two very good RL libraries: PyBrain, and Maja (aka MMLF).
Using either of these libraires, you could built a tetris-playing bot; in fact, PyBrain includes a tutorial based on environment similar to Tetris.