From 89f599e710ef350981061c3d0d8fabc7ddf2dd67 Mon Sep 17 00:00:00 2001 From: mollusk Date: Wed, 3 Jun 2020 02:14:39 -0700 Subject: [PATCH] move title proc to romms file --- src/geedren_mansion.nim | 21 +++------------------ src/geedren_mansionpkg/rooms.nim | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/geedren_mansion.nim b/src/geedren_mansion.nim index 0de55b4..1bccbc3 100644 --- a/src/geedren_mansion.nim +++ b/src/geedren_mansion.nim @@ -17,28 +17,13 @@ when isMainModule: - proc title_screen() = - echo fmt""" - Welcome to Geedren Mansion. You are {player.name}, a capable 24 year old adventurer. - Your uncle Rob has been missing for 10 years. He went hunting for the secrets and treasure rumored to - be hidden deep within the walls of the mysterious Geedren Mansion. Now that you are of age and have - trained in adventuring, you have decided to find your uncle. Your mission is dangerous as many men - have gone missing with the mansion being their last known whereabouts. The door is unlocked and you - walk right in the doors of the massive mansion. + - """ - - stdout.write("Press 1 to contnue: ") - var choice = stdin.readLine() - - if choice == "1": - foyer_room(player) - else: - echo "You pressed the wrong key!" + - title_screen() + title_screen() diff --git a/src/geedren_mansionpkg/rooms.nim b/src/geedren_mansionpkg/rooms.nim index 8692950..a3002ab 100644 --- a/src/geedren_mansionpkg/rooms.nim +++ b/src/geedren_mansionpkg/rooms.nim @@ -5,6 +5,8 @@ import procs, strformat + + proc foyer_room*(player: Character) = var @@ -36,4 +38,22 @@ proc foyer_room*(player: Character) = echo(fmt"{backpack.name}: {backpack.description}") ]# - discard addToBackpack(player, desk) \ No newline at end of file + discard addToBackpack(player, desk) + +proc title_screen*() = + echo fmt""" + Welcome to Geedren Mansion. You are {player.name}, a capable 24 year old adventurer. + Your uncle Rob has been missing for 10 years. He went hunting for the secrets and treasure rumored to + be hidden deep within the walls of the mysterious Geedren Mansion. Now that you are of age and have + trained in adventuring, you have decided to find your uncle. Your mission is dangerous as many men + have gone missing with the mansion being their last known whereabouts. The door is unlocked and you + walk right in the doors of the massive mansion. + + """ + stdout.write("Press 1 to contnue: ") + var choice = stdin.readLine() + + if choice == "1": + foyer_room(player) + else: + echo "You pressed the wrong key!" \ No newline at end of file