You will have to write a lot of short pieces and most of these will need to be able to seamlessly loop, but beyond that, it's not terribly different. A lot of video games offer way more freedom than something like film because most of the time, they just need thematically-appropriate music that can loop, and this makes it much easier to compose music that can stand on its own.
Something like a visual novel would have the soundtrack change alongside dramatic shifts in visuals or the conversation and character expressions, so a new loop or stinger for these changes. However, you'd not want to overdo it and write something different for every little thing that happens in the dialogue or visuals.
One thing that these kinds of games often do, is that they will keep the same loop going throughout most of the conversation or "scene", but they will duck the music out of the way for a second and have some stinger in the same key as the piece (wind run, stab, etc. sky's the limit here) come in when there's a shift in tone, especially if it's only a temporary shift.
So let's say you have some scene at this game show, and you've composed a loop of spooky, monster gameshow circus music or something going in the background. But then, when the player advances the conversation, and one of the characters now gets a twisted expression on their face and becomes angry, but it's only for a a few lines of dialogue, instead of totally changing the loop for that part, you might have a violin screech or something that maybe sounds like a mistake in the music play over top of it, while the music is temporarily ducked in volume.