Tuesday, February 23, 2016

Development Guide and Issue Solving

Last week, I was sick. During that time, I put together an in-depth guide to creating your very own battle (referred to as "encounter" in the guide, for clarity purposes). The guide also contains a description of every class involved in this program, along with methods (for nearly every class) that will/may be useful to you. Creating an encounter should be easy if you read this guide. I'll try to post my latest draft here as soon as I get to a computer; I'm on mobile right now.



In other news, I was working on the engine earlier today. I created a new attack for my battle, using the purple soul. While I was working on this attack, I ran into a problem I had run into before while working on a green soul attack: occasionally, projectiles wouldn't collide with the soul. So I began searching for the problem in my code. Let me tell you, there is A LOT of code. After reading line after line, examining the logic in my head, I decided to display the coordinates of the picture and the collision box of each projectile. The results were: (the x value I set, the y value I set) and (0, 0), respectively. Huh, that's strange. So I looked at the differences between the code for this attack and the ones that worked. Nothing. It looks exactly the same... How strange. But then I looked closer. Turns out that the constructor I used to create the projectiles in this attack was a different one than in the other attack. Aha! After doing some digging through the code (this time following a known path, rather than just randomly searching for problems), I arrived at a dead end: the constructor for CollisionLabel. This is the end of the rabbit hole (or at least, the particular end that I was looking for); the only method calls in this portion of code are for built in methods by Java - there's definitely nothing wrong there, or, at least, nothing I can fix. So I looked over this code, reading the lines a few times. Whatever's wrong must be here... But what? It all looks fine. Then, after looking at a particular line, it hit me. Of course! Turns out that I moved the image to where it needs to be, but I forgot to move the collision box. So I added the extra line, and now everything (directly related to that issue) works now.

No comments:

Post a Comment