Game logic applies programming to game mechanics such as non-player character (NPC) behavior, physics, and enemy AI.