Visar inlägg med etikett 2016. Visa alla inlägg
Visar inlägg med etikett 2016. Visa alla inlägg

torsdag 2 mars 2017

5SD064 Animator Controller.

Animator Controller.


Hi i'm Kevin from team Fenrir. I'm one of the programmers in my group and also the lead sound person. This week I have been working with switching between animations on the player. I have been doing this because me and my team wanted to have animation for the player walking and since the artist of our group is done making the animation sprites I am now implementing them. Before this I had only been putting in animations for objects that only have one animation. So I have been learning to use the animator controller in Unity.

So the player has animations for walking up, down, right and left. when I started doing this I thought that all you had to do was write in the script to play a certain animation at specific times but this could not make the player switch between animations. The way you actually have to do this is assigning triggers, floats, ints or bools for transitions between animations. I decided to assign floats for the transitions which are like if statements outside the script. In the script I assigned the float for the transition to my "Input.getAxis" floats by using the "SetFloat" command. So now when i'm using these transitions the animations do switch but not very properly for some reason the player switch to the ideal sprite from time to time at moments where it shouldn't, but i think this has to do with the pattern of my transitions. It's also possible that the problem would be that the "Input.getAxis" float is the wrong variable to assign the transition to. Maybe I have to assign it to "Rigidbody.velocity" or something.


Now in the last couple weeks of our projects our game is really coming together but I still have to make these transitions work and some minor fixes from our feedback on the play testing session we had on Monday. Next week i'm going to have to make it so that the player can tackle the enemies and a better visual feedback for when you lose health, but before that i have to wait for some sprites to be done by the artist in our group.

torsdag 23 februari 2017

5SD064 Small changes mainly power ups

Hi i'm Kevin. I'm the second programmer and lead sound of the group Fenrir. Where making the game "Bullet Hack" and this week i have been making mostly small changes. We are trying to make a GUI right now so I have been making a health slider and also a slider showing the cooldown of the player bullets. I have also been working on the power ups since we wanted to have three of them and they are all implemented now. Besides programming I have also implemented the walking sound for the player.

Here you can see one of the power ups.

So why did i implement these features? Well the health slider and the power ups are pretty self explanatory but the cooldown slider was something i implemented because when people where testing the game it seemed like they didn't really use the fire rate to it's fullest ability, but now with this slider it is much easier to estimate when you can shoot. I have had the walking sound on my sprint plan for a couple weeks now because I didn't know how to match the sound with the walking, but i wanted it in the game and the group wanted it.

When i started implementing the walking sound to the game I used an "ienumerator" and a "waitforseconds" command but the problem was that the sound file started over before it was done, so the "waitforseconds" command did not work as intended for some reason. I ended up calling a normal function in the update of the script. the function simply plays the audio file within a if statement if the "isplaying" boolean is false. this was a very simple solution that took me more time to figure out than it should have mainly because I tried many different variations of this to get it to work, but i'm not very accustomed to c sharp and Unity API so i guess that is to be expected.

The power ups where a wider shoot (which only required a bigger hitbox) and a bullet that goes through all enemies which only meant that i had to give it another tag and make a if statement that says that it wont be destroyed on collision.

torsdag 16 februari 2017

Visual feedback

Visual feedback


Hi i'm Kevin! I'm the second programmer and the lead sound designer of the group Fenrir. Our group is making the game "Bullet Hack". This week our group has been getting ready for the alpha presentation but the actual game was meeting the requirements already at the start of the week, so the only thing we needed for the presentation was the powerpoint and a title screen. so while the project manager and graphic artist started working on that I decided to start working on the feedback we got from the play testing session we had on Monday.

So this week I have been making the visual feedback of the player getting hit by bullets, since this was one of the things that a lot of people said they felt missing. So what i have done is making the player flash red when hit for one second.

 So to do this I used a ienumerator where I changed the colors of the player to red and then I used "waitforseconds" and changed back afterwards. I put this in a for loop, in the beginning this did not work, instead of flashing red the player became invisible and i couldn't figure out why, but then at the programming workshop on Wednesday I asked our teacher Håkan Mattsson about it and it turned out that the alpha color of the color that i changed the ship to was at zero which made the ship transparent.

So if you'r changing the color of something the way I did remember that the default "Color" variables are set to zero on the alpha color.

I haven't implemented a sound for when you get hit yet, but I will be doing this next. The most important thing for the game right now that I and the lead programmer of our group are going to do is the graphical user interface which is the thing that i will be focusing on now and probably talk about next week.