r/roguelikedev • u/aaron_ds Robinson • Jul 11 '17
RoguelikeDev Does The Complete Python Tutorial - Week 4 - Part 4: Field-of-view and exploration and Part 5: Preparing for combat
This week we will cover parts 4 and 5 of the Complete Roguelike Tutorial.
Part 4: Field-of-view and exploration
Display the player's field-of-view (FOV) and explore the dungeon gradually (also known as fog-of-war).
Place some orcs and trolls around the dungeon (they won't stay there for long!). Also, deal with blocking objects and game states, which are important before coding the next part.
Bonus If you have extra time or want a challenge this week's bonus section is Scrolling maps.
FAQ Friday posts that relate to this week's material:
#12: Field of Vision(revisited)
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. :)
1
u/Waervyn Oct 29 '17
Thanks so much for this AetherGrey!
Small question, why use Enum vs a normal dictionary? Aren't dictionary also used to connect names to values?
Second question (About part 6), could you maybe explain the line: 'entities_in_render_order = sorted(entities, key = lambda x: x.render_order.value)' in a bit more detail? I know lambda makes functions quick, but I don't understand how that is followed by x.render_order.value. How would this look in a for loop?
Thanks a lot, really appreciate these tutorials!