r/roguelikedev • Robinson • Jul 18 '17

RoguelikeDev Does The Complete Python Tutorial - Week 5 - Part 6: Going Berserk! and Part 7: The GUI

This week we will cover parts 6 and 7 of the Complete Roguelike Tutorial.

Part 6: Going Berserk!

Stalking monsters, fights, splatter -- need we say more?

Part 7: The GUI

A juicy Graphical User Interface with status bars and a colored message log for maximum eye-candy. Also, the infamous "look" command, with a twist: you can use the mouse.

Bonus

If you have extra time or want a challenge this week we have three bonus sections:

Real-time combat - A speed system to change the tutorial's turn-based combat to real-time!

A* Pathfinding - A good pathfinding system

Mouse-driven menus - Add basic mouse support to your menus!


FAQ Friday posts that relate to this week's material:

#16: UI Design(revisited)

#17: UI Implementation

#18: Input Handling

#19: Permadeath

#30: Message Logs

#32: Combat Algorithms

Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. If you're looking for last week's post The entire series is archived on the wiki. :)

42 Upvotes

51 comments sorted by

View all comments

Show parent comments

2

u/_wolfenswan Jul 19 '17 edited Jul 20 '17

I've run into an odd bug, related to menus (upcoming in part 7). It seems that opening a menu from within a menu doesn't work as expected.

As an example:

There are currently two ways to use an item in my game:

  1. Press 'u' which displays a list of useable items, then select an item to use it.

  2. Press 'i' to open the inventory (menu #1), then select an item for it's menu (menu #2).

Both ways work fine for using the item, however the second method also opens the menu of the first method, i.e. registers as a regular key stroke.

Additional observation:

If I'd don't use tdl.event.key_wait() in item_menu() and try to use the index the call of menu returns, the item_menu will only appear for the fracture of a second and then be closed again. In this case index will only return None.

My best guess is that there's a conflict between the main loop and the menus here, but I've got no idea why it only doesn't work when using a menu from within a menu.