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.

torsdag 9 februari 2017

Power Up #1

Hi my name is Kevin Johansson and i am one of the programmers for the group Fenrir. Our group is making the game Bullet hack and this week i have been making the first power up. In our game you play as a object shooting other object in certain segments like a traditional shoot em up. So our first power up is increased fire rate for the player. The power ups are picked up in another segment of the game where you walk around in a hub world like thing. so right now i have it so that if you press the "F" key you get increased fire rate. So to make this work I  made a individual prefab for a power up bullet which is identical to the original bullet prefab except it has a faster fire rate. when scripting how the player should switch it's prefab i made it so that the script makes the game object variable for the original bullet prefab is equal to the power up bullet prefab which means that it can't revert to it's original form, but i will change that later. I will also make a power up orb that you can pick up in the hub world. So making the power up took way longer to do than it should have since i did not think of this method until after trying some other ways of doing this. So when i realized that it was this easy to do i was pretty shocked that i hadn't tried this earlier.


After being done with making the power up work  i decided to make the power up bullets have a different color as well so that people now that they used their power up. I will also ad a sound for the power up when i find one. we where thinking that we should probably have like 2 or 3 different power ups in the actual game and the next power up is going to be a double shot so that the shot has more width. Before making this next power up i will be making the graphical user interface  for the rest of this week and some small changes.

power up sound