From 419b729672dcd4ce3fb1d9ad7c791c1ab67f8ba0 Mon Sep 17 00:00:00 2001 From: buttchicken Date: Mon, 25 May 2020 22:11:57 -0700 Subject: [PATCH] First content commit --- geedren_mansion.nimble | 15 +++++++ src/geedren_mansion.nim | 67 ++++++++++++++++++++++++++++ src/geedren_mansionpkg/objects.nim | 22 +++++++++ src/geedren_mansionpkg/submodule.nim | 6 +++ 4 files changed, 110 insertions(+) create mode 100644 geedren_mansion.nimble create mode 100644 src/geedren_mansion.nim create mode 100644 src/geedren_mansionpkg/objects.nim create mode 100644 src/geedren_mansionpkg/submodule.nim diff --git a/geedren_mansion.nimble b/geedren_mansion.nimble new file mode 100644 index 0000000..3b9a100 --- /dev/null +++ b/geedren_mansion.nimble @@ -0,0 +1,15 @@ +# Package + +version = "0.1.0" +author = "buttchicken" +description = "Mystery game in haunted mansion" +license = "MIT" +srcDir = "src" +installExt = @["nim"] +bin = @["geedren-mansion"] + + + +# Dependencies + +requires "nim >= 1.2.0" diff --git a/src/geedren_mansion.nim b/src/geedren_mansion.nim new file mode 100644 index 0000000..8099940 --- /dev/null +++ b/src/geedren_mansion.nim @@ -0,0 +1,67 @@ +# This is just an example to get you started. A typical hybrid package +# uses this file as the main entry point of the application. + +import geedren_mansionpkg/objects +import strformat + +when isMainModule: + + var phone = Item( + name: "Phone", + description: "Communication device/ pocket computer" + ) + + var player = Character( + name: "Sam", + backpack: @[phone] + ) + + + + +# Room 1 of mansion + +proc foyer_room() = + + var foyer = Room( + name: "Foyer", + description: "Entrance Hall of the Geedren Mansion", + text: """ + zdsfgzdfg + """, + secrets: 2 + ) + + var desk = Item( + name: "Desk", + description: "A small wooden desk", + contents: "key" + ) + + echo foyer.text + +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(foyer) + else: + echo "You pressed the wrong key!" + + + + + + +title_screen() diff --git a/src/geedren_mansionpkg/objects.nim b/src/geedren_mansionpkg/objects.nim new file mode 100644 index 0000000..002566e --- /dev/null +++ b/src/geedren_mansionpkg/objects.nim @@ -0,0 +1,22 @@ +type + Item* = object + name*: string + description*: string + contents*: string + + Character* = object + name*: string + backpack*: seq[Item] + + Secret* = object + description*: string + found*: bool + + Room* = object + name*: string + description*: string + text*: string + secrets*: int + + + \ No newline at end of file diff --git a/src/geedren_mansionpkg/submodule.nim b/src/geedren_mansionpkg/submodule.nim new file mode 100644 index 0000000..9a7537a --- /dev/null +++ b/src/geedren_mansionpkg/submodule.nim @@ -0,0 +1,6 @@ +# This is just an example to get you started. Users of your hybrid library will +# import this file by writing ``import geedren_mansionpkg/submodule``. Feel free to rename or +# remove this file altogether. You may create additional modules alongside +# this file as required. + +proc getWelcomeMessage*(): string = "Hello, World!"