Monday, August 3, 2015

New Spell! - Gust, Charge Up Mechanic

Gasp it's been a long time! I hate seeing the date on my last post and thinking of how long it's been! I randomly started working on another mini-game a while back, and then for most of this year haven't been able to get back into O of M. Finally I got back on, got some things going, and was able to catch back on to where I left off! It was great to develop out a bit more of the spell mechanics, and I really like what I've been able to accomplish.

When I pulled the game back up after months of it gathering dust, the biggest issue I found was that the cast spell using the storm rune was vastly underdeveloped and basically broken. Originally (before I changed to the ice barrage) his channel spell was the beam of lightning, and the single cast spell was a form of ball lightning. This spell was a large projectile that started out slow and then proceeded to speed up quickly towards the enemy (think of Samus's missile's behavior). It was a decent idea, but due to some coding bugs it didn't work very well, and honestly didn't live up to the expectations I had for it. The visual wasn't even that great either:

Well, it wasn't terrible. But as it was moving across the string it was just very lackluster. When compared with the fireball spell, it just didn't feel unique enough either. So, that's when I got thinking of a different approach to the storm rune. I decided on using a wind type spell. My original plan was a  spell that would just shoot some air, push back enemies, simple as that.

The visual started out terribly :D I'll admit I'm a little bit rusty on pixel animation, but this one was just bad. It was like a wiggly, warbling, crippled cloud. The coding didn't prove to be too difficult at first. Just made the speed decay over time, added some transparency, pretty basic. A little moment of coding awe came when I added the pushback. I knew that I needed the gust to just add an x value to the enemy it hit, so at first I just did a straight number, 3 or something. This worked a little bit, but since the enemy is moving a certain amount as well, it was just kind of choppy. So, since the gust was following an x formula like flyspeed x decay x decay, I just used that exact formula for the push! Now it pushes things away at the same speed it flies! Yay for coding :D

The final touch for the spell that gave me a LOT of trouble, was adding a charge up to the spell. At first it was a simple button push makes a gust. But with the way I wanted it to work, it felt like it would work perfectly with a charge up. I spent probably one or two hours trying to crud my way through it, and just using button presses, holds, releases, while loops, etc, it crashed the game every time. After sleeping on it for a night, I started from square one and tried to new approach, and BAM! Success! I still am tweaking the numbers to make it work right, but man it turned out well! Check out the functional new storm spell, Gust:


Next step I have planned, adding new enemies with more advanced behaviors!

2 comments:

  1. Oh my gosh, that is so cool!! I can already hear the sound effect in my head as I watch it! What an awesome mechanic, and I can't believe you hardcoded it from scratch! I bet that's the funnest part for you. Maybe you should make it so that it automatically releases when it's all the way charged, or it makes him squint and start sweating and moving more slowly, or maybe just makes a little spark to let you know there's no point in charging up anymore. Either way, holy cow I love it!

    ReplyDelete
  2. Yeah! The way it is now, it can charge up indefinitely, but since it's an exponential decay, it still stops in a fairly reasonable way. But, that is my plan to make some sort of status to show its charge. Whether it's a full charge, or maybe even a charge progress. I did just realize I need to make it slow down the mana regen as it's being held.

    ReplyDelete