system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do programmers merge code and visuals in video-games?

I know how the code works for basic games (Snake, Flappy Bird etc.) but can't understand the mechanics behind the games like Tomb Raider or Call of Duty.
gpt
They follow the same general logic. The only real difference at that level is just the complexity of the different parts. There's still a main game loop that updates game states and handles inputs. There's still a rendering loop that draws the visuals and so on.

Take a look at Unity. Unity has been used to build games from super simple ones to complex AAA titles. They all follow the same general pipeline. It's just a question of how much the game has to do between updates.