The goal was:
Work on Bugs and Create Rooms
I didn't spend much time working on BlockPusher but I was able to squash a tricky bug. The game was crashing after completing certain rooms and I was very confused as to why. I used trace() on several things and eventually saw that some indices of my allWorldObjInThis array were blank due to some rooms having blank spaces. So when the game went to change to a new room, it first removes from the world everything that makes up the completed room. EntityPlus tried to remove all indices of allWorldObjInThis in its removed() function, and some were null.
I could just skip pushing the blank spaces into allWorldObjInThis but instead decided to make the blank spaces Hole tiles and then change their visible property to false. This should actually prevent a future problem which would happen when the user moves a block to a blank space. The move calculation will look at the blank space as a Hole tile and give the desired reaction of a blank space.
No comments:
Post a Comment