I intend to present a theme of unpredictability in a current project of mine by having the tone shift from being highly light-hearted and comedic to a more serious, high-stakes tone retaining comedy only in the form of an inherently morbid sense of humor. If one wished to relay a certain tone or mood in their writing, what things should they consider? And what is the proper way to go about shifting a story's tone and mood throughout? What things should one considering when transitioning from a comedic tone to a more serious one? How would one write a properly "comedic" story, even if its just a fragment of the story, without it being seen as a joke? Portal and Portal 2 do the inherently morbid sense-of-humor interjected into the narration quite well, but how would translate that kind of narration into novel form? How could one write something that both has a sense of humor but presents itself as properly serious at the same time?
I completed my first comedic novel last year and I too struggled with this problem. My solution to making the tone do a complete 180 in the climax was rather simple, I just raised the stakes. My main character began the story as the extremely arrogant god of small to medium sized lizards by the name of Lacerto, who believed he was immortal. I put him in a situation where he could be killed for the climax. This allowed me to write serious scenes from his perspective without his inherit comedy coming through. The way I was able to shift narrative tone from comedic to serious was possible only because he was immortal at the start, but this strategy could work for any story in which the protagonist begins with a false assumption that is proven to be false in the conclusion. Good luck solving your problem Isaac 223! By the way the name of my book is A Tale of Gods, Mortals, and Jell-o shooters.
I'd recommend Catch-22 for a study in shifting tones. That one goes from ha-ha to wanting to hug a puppy.