K-Mistele / seeker-of-the-sword

ascii-character adventure code written into console via python
Other
5 stars 0 forks source link

In branch mob-generation, game sometimes crashes on first move #20

Closed K-Mistele closed 6 years ago

K-Mistele commented 6 years ago

Sometimes on the player's first move, the game will crash on the first move. It seems as though this has something to do with the collision detection algorithm for mobs. Will comment with error message when bug triggers again.

K-Mistele commented 6 years ago

Traceback (most recent call last):

File "C:/Users/kyle/Documents/GitHub/ascii-adventure/adventure.py", line 257, in if (len(mob.detect_monster_collision(coord, direction)) > 1 and File "C:/Users/kyle/Documents/GitHub/ascii-adventure\entity_classes.py", line 46, in detect_monster_collision if self.occupied_tile.char(self.x_index+direction, self.y_index) not in self.viable_tiles: File "C:/Users/kyle/Documents/GitHub/ascii-adventure\tile_classes.py", line 92, in char return self.tile[y_index][x_index-1] IndexError: list index out of range

K-Mistele commented 6 years ago

The problem seems to involve when mobs spawn on the world border. I'll have to go in and fix mob spawning

K-Mistele commented 6 years ago

Possibly Fixed, see commit 3b31f6a.