Kaworu
Active Coder
Hi!
I am following the Python Roguelike tutorial. I am currently in the 6th part of it. And in my source code there is an error I cannot fix myself.
When I am trying to run main.py, the window with the game gets generated. However, when I try to make any move, an error occurs:
I am not really sure what is not working, but I have a suspicion. In
And I believe that for some kinda reason, this is where things go bad (I think?). However, I have totally no idea WHY it's not working...
The full source code is on my GitHub, here. I would appreciate any help.
I am following the Python Roguelike tutorial. I am currently in the 6th part of it. And in my source code there is an error I cannot fix myself.
When I am trying to run main.py, the window with the game gets generated. However, when I try to make any move, an error occurs:
Code:
Traceback (most recent call last):
File "C:\Users\DELL\Desktop\My_Roguelike\main.py", line 65, in <module>
main()
File "C:\Users\DELL\Desktop\My_Roguelike\main.py", line 62, in main
oEngine.event_handler.handle_events()
File "C:\Users\DELL\Desktop\My_Roguelike\input_handlers.py", line 32, in handle_events
action.perform()
File "C:\Users\DELL\Desktop\My_Roguelike\actions.py", line 89, in perform
if self.blocking_entity:
File "C:\Users\DELL\Desktop\My_Roguelike\actions.py", line 51, in blocking_entity
return self.engine.game_map.get_blocking_entity_at_location(*self.dest_xy)
File "C:\Users\DELL\Desktop\My_Roguelike\actions.py", line 17, in engine
return self.entity.gamemap.engine
AttributeError: 'Entity' object has no attribute 'gamemap'
I am not really sure what is not working, but I have a suspicion. In
entity.py
I have a class Entity
with a line:gamemap: GameMap
And I believe that for some kinda reason, this is where things go bad (I think?). However, I have totally no idea WHY it's not working...
The full source code is on my GitHub, here. I would appreciate any help.