The first Blog

The first Blog

Hi! I’m Gabriel Ringmar, Lead coder of Team Nazgul and I’ll be discusing some issues I got when Implementing the movement for the main character in our game that is now in development, Burn Witch Burn.
                                         “gilli animation”

In Burn witch burn you play as the main character Gilli a fire witch the flies on her broom. This was my first time working on unity but I tried an played around a bit. I implemented a arrow that could move with some basic ”if ”statements and it worked. The day after I saw some tutorials of how others implemented it and got quite different feedbacks, so I decided to do everything again. It didn’t take long to do and it used some unique variables in unity, such as (GetAxis”horizontal” or ”vertical”) that checks the usual inputs for moving a charater in a game (for example; wasd or the arrow keys).

It worked and it looked good so I kept it that way. The issue came after, when I added the sprites and the animations, because I needed something to tell the game to change the animations, so I did the ”if” statement implementation again. Now I had two different scripts that check for inputs and does something related to the movement of the player. I kept it like that for the pre-alpha but I have to do something about it, to have it all more optimized and better implemented. I want to keep the second implementation, because gave aditional inputs such as the arrow keys in less code. I’ll have to figure something out.

Another issue with the implementation of the animations and movement, was that sometimes it didn’t change at all. I couldn’t figure out why it behaved like that. It happened only when spamming opposite dircetion keys like up and down. Our other coder Oscar had something similar to my code but instead of checking for the name of the animation, he checked for a number that corredspond to a certain animation. At first thought it was a bit confusing since you couldn’t now which number it corresponded to. But he didn’t the same animation issue I got, so after some thinking I realized that his method was more optimized than mine and it could change the animation better and faster since it only checked for a number instead for a name that would take longer.

Leave a comment