Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

C# Scripting Power Ups

Discussion in 'Scripting' started by Dalamarelven, May 25, 2014.

  1. Dalamarelven

    Dalamarelven

    Joined:
    May 25, 2014
    Posts:
    2
    I'm creating a game for my class where the character is able to pick up one of 4 varieties of Power Ups; my main issue is that I'm new to the whole scripting aspect of this program and can't figure out how to write scripts for the various powers. Does anyone know of a decent tutorial on this particular subject? I've tried looking around and am having limited luck on this. Any help would be greatly appreciated.
     
  2. AlpacaMaster

    AlpacaMaster

    Joined:
    Jan 30, 2014
    Posts:
    32
    What power ups do you need? Maybe you can make them chabge a variable?
     
  3. Dalamarelven

    Dalamarelven

    Joined:
    May 25, 2014
    Posts:
    2
    Sorry for the delay in posting, I had work and the internet connection sucks as of late. Anyways, I'm attempting to make different powerups along these lines:

    Powerup that allows him to flap faster

    Double bonus powerup

    Teriyaki powerup allows him to jump off walls and punch and kick

    The buffalo powerup increased dmg

    All powerups are lost once you’re hit. Buffalo Powerup takes 2 to lose.

    I'm understanding C# to a point but haven't found any decent tutorials on how to script something like this, so any help or tutorials that you could point me towards to complete this would be greatly appreciated.
     
  4. zDemonhunter99

    zDemonhunter99

    Joined:
    Apr 23, 2014
    Posts:
    478
    You won't find tutorials for something like this. You need to apply your own brains and create logic. It is actually exceedingly simple to make such powerups. I can list a few ways you can make a few of the powerups.
    For the powerup with allows the character to flap faster, increase the variable which defines the speed at which your character can flap. Create a Boolean which checks wether it has been used and if it has been, set it to true and disable it's use. As for the buffalo powerup, you need a variable which contains damage and just double the value of the variable.