Tuesday, May 21, 2013

Restructuring

Moving? Check. Jumping? Check. Trail of lives following the avatar? Check. Switching between lives? Check... ish.
I am on a roll. GML continues to get easier and I solved a lot of the bugs I was having. I got the avatar moving and jumping without a hitch. I got the other lives to follow the avatar. I solved my jumping and getting stuck in the floor issues. So today I wanted to tackle switching between lives and picking up powerups. On my first try I thought I got it. I was able to switch between lives. However, the more I switched the more the other lives couldn't follow the avatar. I put a bunch of print statements in and found what was wrong. I structured the cats into an array. They stored their indices in an internal variable that way they could reference each other. However, their internal indices were completely different from their array indices and that started to cause major trouble with how I had them following each other.
I realized what I really wanted was to make a queue. So right now, I'm restructuring my code in order to have my manager object control how all the inactive lives are moving as well as how they switch. I'll see you all tonight.

No comments:

Post a Comment