SelinaDev / Godot-Roguelike-Tutorial

Yet Another Roguelike Tutorial in Godot
MIT License
78 stars 10 forks source link

Part 06 - reference to player instance in map_data is not set. #26

Closed ejfudd closed 3 weeks ago

ejfudd commented 1 month ago

In the refactor in part 06, the tutorial is missing the additional parts to set player in map_data. The tutorial works fine until you get to the AI section.

game.gd has the change to creating the player, but the additional changes are not reflected.

map_data.gd needs to add the player parameter to _init() and set it in the code. Adding the player variable is shown in the pathfinding section of the tutorial but is not talked about and assumed to have been added earlier. dungeon_generator.gd needs to add the player parameter to the MapData.new() call.

These changes are only needed in the tutorial text. The code correctly reflects these changes.

Edit: Is this appropriate here since it's only a tutorial change and not an issue with the code?

SelinaDev commented 3 weeks ago

Thanks a lot for noticing this, and for the clear instructions. Sorry for the late reply, but today I got the chance to fix this. I just uploaded a new version that mentions the changes to map_data's _init() function and the invocation of that constructor. Hope all's clear now.