Monday, August 22, 2011

Let's Make A Game! Episode 10: I DID IT

I've been going CRAZY lately. I did the parallaxing tutorial and got nowhere for days. Every time I would make the tutorial, I would crash the program or create all sorts of bugs. I finally got fed up with it and was thiiiiiis close to quitting.

I was especially upset because it appeared to me like I had entered in everything correctly. It had to be a typing error, right? I mean, it's not like I could have made a mistake somehow.

Finally, I tried just copy-pasting the code over and got EXACTLY THE SAME THING. At this point, I was ready to chuck my computer through the window and become a Buddhist monk. I set everything aside for a day in hopes that maybe I wouldn't want to murder something when I returned.

I returned to the tutorial tonight and gave it another shot. Maybe this time things would be different.

I opened up by re-doing the animation tutorial. Since I forgot to actually READ what I was doing, I found that I gave this new animation class the wrong name and ended up with a pile of errors. I couldn't figure it out until I went back realized that somewhere I hadn't named my class the right thing. I had given it the name of animation.cs instead of Animation.cs. I knew that this stuff was case-sensitive, but somehow I always forget that when push comes to shove.

Anyway, after I fixed the problems formed by my own lack of comprehension, I got the same weird result as the previous attempt at animation: My character can easily wander offscreen without me wanting it to happen. I decided that I wasn't going to stress about it too much, as I was certain that I had copied the math and information over properly. Besides, the most important thing was forward progress at this time.

I moved back to the parallaxing tutorial and copy-pasted the code in the right places. A deep breath, and a press of Ctrl + F5...

Finally! Now that I have the completed result in front of me, now I can go back and figure out WHY it worked. I'm so glad my long national nightmare is over.

This is such a good way to ring in my 30th year. Woohoo!