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

2 kommentarer:

  1. Hi Kevin.

    One way you can try to change bullet and still be able to change it back later is to make a reference GameObject.
    For example:

    public GameObject defaultBullet;
    public GameObject powerupBullet;
    public GameObject activeBullet;

    Start() {
    activeBullet = defaultBullet;
    }

    Then just do stuff with activeBullet, and change it to something else when you need to.


    When it comes to the structure of the blogg there are some things you might need to think about.

    Try to split up the text a bit more :p
    I tend to go overboard with spacing in my writing but I prefer too much spacing over too little.

    I don't think we need to explain ourselves too much, but I think it's good to tell the reader that you are working in Unity before using words like "prefab", just to give a bit of context.

    It's good if you make a comment on your links, because when I clicked it and it took me to abother web page with an unrelated name I thought it was some sort of auto generated ad :p


    Good luck in the future :)

    Robin
    Team Elf

    SvaraRadera
  2. Hey Kevin

    It is clear from the blog that you have created a powerup increases the fire rate of the player.
    When you want to change values for the player, such as rate of fire or movement speed, you could make a script that hold some values.
    This would allow you to create several objects using a single script, and then collect these values with a function inside the player.
    If you want this powerup to only last for a certain duration, you could simply add a variable for time, as shown in the example below.

    float poweruptimer = powerupscript.timer;
    if (poweruptimer > 0.0f)
    {
    poweruptimer -= Time.deltaTime;
    }
    else
    {
    myShootingCooldown = Standardvalue;
    }


    About the structure of the blog, just the like Robin, I do feel that the text is a bit cluttered and would look much better with a bit more spacing. There are also misspellings scattered throughout the post that if fixed would give a better feel to the blog.

    Best of luck with the remainder of the project.
    //Leo, team Elf

    SvaraRadera