I'm using libtcod and python to make a roguelike; the tutorial I'm following the monsters only follow you if you're in their field of view. Obviously this is insufficient; as it means you can turn a corner and they don't follow you around the corner.
I tried something like this;
class BasicMonster:
def take_turn(self, seen):
self.seen = False
monster = self.owner
if lib.map_is_in_fov(fov_map, monster.x, monster.y):
self.seen == True
if self.seen == True:
self.move_towards(player.x, player.y)
To no avail. It raises
TypeError:
take_turn()
takes exactly 2 arguments (1 given)
Not sure how to implement this.
I'm calling I'm calling take_turn under
if game_state == 'playing' and player_action != 'didnt-take-turn':
for object in objects:
if object.ai:
object.ai.take_turn()