First content commit
This commit is contained in:
parent
deb31d5114
commit
419b729672
15
geedren_mansion.nimble
Normal file
15
geedren_mansion.nimble
Normal file
@ -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"
|
67
src/geedren_mansion.nim
Normal file
67
src/geedren_mansion.nim
Normal file
@ -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()
|
22
src/geedren_mansionpkg/objects.nim
Normal file
22
src/geedren_mansionpkg/objects.nim
Normal file
@ -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
|
||||
|
||||
|
||||
|
6
src/geedren_mansionpkg/submodule.nim
Normal file
6
src/geedren_mansionpkg/submodule.nim
Normal file
@ -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!"
|
Loading…
x
Reference in New Issue
Block a user