Compare commits
No commits in common. "493b663b4e9ee2cb33d4409416b24884b620637a" and "2f8dd761ba929b7c41b66ff5f938857a1653c6bd" have entirely different histories.
493b663b4e
...
2f8dd761ba
|
@ -34,7 +34,7 @@ class GameNavigator(npyscreen.FormBaseNew):
|
||||||
This may not be needed in the future, dynamic
|
This may not be needed in the future, dynamic
|
||||||
handling of location is something the navigator should do and should inherit from player.
|
handling of location is something the navigator should do and should inherit from player.
|
||||||
"""
|
"""
|
||||||
self.artBox.footer = location
|
pass
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
top_division_height = 20
|
top_division_height = 20
|
||||||
|
@ -58,13 +58,13 @@ class GameNavigator(npyscreen.FormBaseNew):
|
||||||
editable=False)
|
editable=False)
|
||||||
self.artBox.footer = 'Unknown Location'
|
self.artBox.footer = 'Unknown Location'
|
||||||
|
|
||||||
self.inventoryBox = self.add(npyscreen.BoxBasic,
|
self.artBox = self.add(npyscreen.BoxBasic,
|
||||||
name='Inventory',
|
name='Inventory',
|
||||||
max_width=inventory_width,
|
max_width=inventory_width,
|
||||||
max_height=top_division_height,
|
max_height=top_division_height,
|
||||||
relx=1,
|
relx=1,
|
||||||
rely=2,
|
rely=2,
|
||||||
editable=False)
|
editable=False)
|
||||||
|
|
||||||
self.logBoxOutline = self.add(npyscreen.BoxBasic,
|
self.logBoxOutline = self.add(npyscreen.BoxBasic,
|
||||||
max_width=inventory_width + art_width,
|
max_width=inventory_width + art_width,
|
||||||
|
@ -108,11 +108,10 @@ class GameNavigator(npyscreen.FormBaseNew):
|
||||||
its up to Handler.py to actually play the game, but we should
|
its up to Handler.py to actually play the game, but we should
|
||||||
do some basic initalization here
|
do some basic initalization here
|
||||||
"""
|
"""
|
||||||
# TODO: load art from the last place the player was in
|
#TODO: load art from the last place the player was in
|
||||||
# TODO: load up inventory
|
#TODO: load up inventory
|
||||||
|
|
||||||
# TODO: Expand this by loding the text from the game
|
#TODO: Expand this by loding the text from the game
|
||||||
# WARN: THIS MAY REQUIRE REWRITING HANDLER.PY TO INTALIZE THE ROOM OBJECT OUTSIDE OF HANDLER.PY
|
#WARN: THIS MAY REQUIRE REWRITING HANDLER.PY TO INTALIZE THE ROOM OBJECT OUTSIDE OF HANDLER.PY
|
||||||
self.update_log('Welcome back! Try "LOOK AROUND" to get started.')
|
self.update_log('Welcome back! Try "LOOK AROUND" to get started.')
|
||||||
self.update_log(
|
self.update_log('>>Note from joe: Welcome! you\'re playing the demo! Please dont mind text issues like |this| and *this*\ni have yet to implement color!')
|
||||||
'>>Note from joe: Welcome! you\'re playing the demo! Please dont mind text issues like |this| and *this*\ni have yet to implement color!')
|
|
||||||
|
|
|
@ -101,16 +101,16 @@ class Handler(npyscreen.ButtonPress):
|
||||||
self.parent.update_log("You must specify something to pick up.")
|
self.parent.update_log("You must specify something to pick up.")
|
||||||
|
|
||||||
elif command == 'OPEN':
|
elif command == 'OPEN':
|
||||||
try:
|
#try:
|
||||||
self.parent.parentApp.log.info('Player tried to open door: {0}'.format(arguments[0]))
|
self.parent.parentApp.log.info('Player tried to open door: {0}'.format(arguments[0]))
|
||||||
new_room = room[arguments[0].lower()]['leads_to']
|
new_room = room[arguments[0].lower()]['leads_to']
|
||||||
self.parent.parentApp.log.debug('New room is: {0}'.format(new_room))
|
self.parent.parentApp.log.debug('New room is: {0}'.format(new_room))
|
||||||
upon_enter = player.change_room(new_room) # Change the player to that new room.
|
upon_enter = player.change_room(new_room) # Change the player to that new room.
|
||||||
self.parent.update_log(upon_enter) # Print the new room upon enter text.
|
self.parent.update_log(upon_enter) # Print the new room upon enter text.
|
||||||
except KeyError:
|
#except KeyError:
|
||||||
self.parent.update_log("You cant open that.")
|
# self.parent.update_log("You cant open that.")
|
||||||
except IndexError:
|
#except IndexError:
|
||||||
self.parent.update_log("you must specify something to open")
|
# self.parent.update_log("you must specify something to open")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.parent.parentApp.log.info('Player\'s command was not understood: {0}'.format(command))
|
self.parent.parentApp.log.info('Player\'s command was not understood: {0}'.format(command))
|
||||||
|
@ -123,15 +123,6 @@ class Handler(npyscreen.ButtonPress):
|
||||||
# Log the command that we parsed
|
# Log the command that we parsed
|
||||||
self.parent.parentApp.log.info('Parsed command "{0}" with arguments "{1}"'.format(command, arguments))
|
self.parent.parentApp.log.info('Parsed command "{0}" with arguments "{1}"'.format(command, arguments))
|
||||||
|
|
||||||
"""
|
|
||||||
Do a little bit of final setup, change the art if we
|
|
||||||
need to, change the text at the bottom and update the inventory.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
self.parent.update_location(room['name'])
|
|
||||||
except KeyError:
|
|
||||||
self.parent.update_location('Unknown Location')
|
|
||||||
|
|
||||||
# Make sure to re-draw the art box when we're all done (in case we updated it in logic above)
|
# Make sure to re-draw the art box when we're all done (in case we updated it in logic above)
|
||||||
self.parent.artContent.display()
|
self.parent.artContent.display()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
room:
|
room:
|
||||||
name: "Your Office"
|
|
||||||
grid: [0, 0]
|
grid: [0, 0]
|
||||||
upon_enter: "You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|"
|
upon_enter: "You are standing behind your desk, you see a |NAMEPLATE|, a |TAPE RECORDER| and your trusty |LOG VIEWER|"
|
||||||
look_around: "You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|"
|
look_around: "You look around the room, you see a |DESK|, a |BOOKSHELF| and the |DOOR|"
|
||||||
|
|
Loading…
Reference in New Issue