The programmer added sound effects to their game by first creating a new sound and adding single shot and submachine gun sounds that could be used for the player's and enemy's weapons. These sounds were then added into the code so that they play in the game as the sounds of the player and enemy shooting.