If my game if you leave from the door I want the game to display some ending text and then restart, re-triggering all of the starting game text.
How can I as the programmer trigger a restart?
with my code.
the start text
When play begins:
say “‘Buzz…Buzz’ Your alarm clock goes off at 6:00am waking you. You get up from bed, shower and get dressed for work. Nice pants, nice shirt, suit jacket. You eat breakfast. Toast, coffee, bowl of cereal. Brush you hair, glance out the kitchen window for the weather, get your coat and shoes. Pause. Hating your job, boring, predictable, the kind of job you only do fo a regular income hating every moment of it. Hating your apartment, tiny, dull, plain, expensive. Hating youself, your aweful job, no dates or relationships in site, everyday just getting older. Hating watching your life just slide away, no ambition, nothing changes, just one day following into another. You wish you could just get away, escape your job, your boring life, maybe even yourself.
But work awaits. [line break]”
Leaving by the door triggures ending text
Instead of going from the apartment to a room which is not in the apartment the first time:
say “If I wait around any longer I will be late. But I really don’t feel like going to work today.”; [as a warning b/c leaving ends in death]
Before going from the apartment to a room which is not in the apartment for more than the first time:
say "You surrender to normalacy and leave for work. 8 hours later you return home, cook dinner for yourself, watch TV until 11pm and go to bed. ";
end the game saying “Your last thought before dropping off to sleep is ‘I hope tomorrow is different.’”;
then the game would restart and reprint the start text