Thursday, March 24, 2016

Win Conditions!

This week, I've been working on win conditions. I've added both win conditions: MERCY and FIGHT. Win by MERCY becomes available when the "sparable" boolean class variable is set to true. The monster's name and the "spare" option will turn yellow, indicating that the monster can be spared. Win by FIGHT happens when the monster's health reaches zero. The monster will disintegrate, and when the animation is over, it will display that the player has won. This animation was especially difficult. I built it entirely from the ground up, moving the image pixel by pixel. I also ended up with some funny bugs, one of them resulting in a "closing shades" animation:

I did eventually get the real animation working, though it's slightly different than it is in Undertale. Turns out that it's a really hard effect to duplicate.

Wednesday, March 9, 2016

Bug Fixes and Damaged Monster Image

This week, I fixed two pretty annoying bugs. In yellow soul, the pellets fired would occasionally phase through projectiles, and on green soul, when you had invincibility frames, projectiles would phase through the soul instead of disappearing. All I changed was before I only checked for collisions when the soul didn't have invincibility frames, but now, it always checks.

Also, now when you hit the monster, it changes its image to another one.

Tuesday, March 1, 2016

Game Over Animation

Today and yesterday, I created the game over animation and added a new method to ProjectileManager. This method is called every time a pellet shot from the yellow soul collides with a projectile. It can be overridden to do special things, for example, play an animation.

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.

Wednesday, February 10, 2016

Pictures, as promised

A few posts ago, I promised some pictures, so here they are. In the meantime, I've also added the ability to play sound, but since I can't capture that with a screenshot, I'll have to improvise.

Ding!  The blue soul.

Pew pew. The yellow soul.

This one doesn't really have sound effects...

Unfortunately, I was unable to get a screenshot of the actual attack with the animation and health bar fast enough. I'm doing this on a Mac right now, and, as Mac users know, you can't get a screenshot and do controls at the same time. At least, I don't know how to do that.

Friday, February 5, 2016

Submenu Navigation

I've been avoiding it for a while, but today I finally coded the submenus. Now item, act, and mercy can have submenus, and you can even move your cursor around them! I've programmed the mercy menu first, since it's always the same. Setting up the act menu will be up to the Battle subclass that's currently running, and item will be set up dynamically. Good progress!

Tuesday, February 2, 2016

Soul Colors and Fighting!

Over the weekend, I put in some work on the engine. I finalized the attack option and allowed the main game loop to pause to allow smooth transition from the player's attack to the monster's attack, with no jumpiness. Everything there is working properly now.

I've also been working on different soul colors. This week, I've implemented blue soul (gravity affected for those of you who haven't played), yellow soul (grants the ability to shoot projectiles), and purple soul (places the soul on strings). I'll include pictures later.