I always enjoyed Pac Man and its various clones on home computers, so it was a natural choice. It's been quite a long process and required a lot of work. The maze is based on a 17x17 grid which is split into passable and impassable squares. Pacman and the ghosts can only travel through passible squares. The maze is constructed from different pieces of maze placed into each of the impassable grid squares. The dots and power pills are placed in the passable grid squares. If you look carefully at the picture below you can probably see where the grid squares are.
It was fairly straightforward to get PacMan moving. He moves constantly, like in the original. To ensure he can only goes in the passible squares, a check is made in the direction being moved to see if the next square is passible. If it is he goes into it, otherwise he stops. If his direction is changed then a new check is made in that direction, allowing him to get moving again.
The ghosts were the most fun to do. I found an article which explained their tactics. For example the red ghost heads directly for the square occupied by PacMan, whereas the pink one heads for two squares ahead of PacMan. This results in these two ghosts sometimes catching PacMan in a pincer like movement - something I remembered from playing the game. It was a pleasure to get this working.
Each ghost has a target square to get to and this gives them a direction in which they'd like to move. They then do a check like PacMan and if they can't move in that direction they also have a secondary direction in which they'll try to move. This is perhaps better explained by the picture below which has the debug information I used displayed.
It was great fun making PacMan and I recommend trying to recreate games as a great way to learn programming.