Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        // Initialize Public Instance Variables
        this.velocityRange = new VelocityRange(300f, 30000f);

        // Initialize Private Instance Variables
        this._transform   = gameObject.GetComponent <Transform> ();
        this._animator    = gameObject.GetComponent <Animator> ();
        this._rigidBody2D = gameObject.GetComponent <Rigidbody2D> ();
        this._move        = 0f;
        this._jump        = 0f;
        this._facingRight = true;

        // Setup AudioSources
        this._audioSources    = gameObject.GetComponents <AudioSource>();
        this._jumpSound       = this._audioSources [3];
        this._coinSound       = this._audioSources [2];
        this._hurtSound       = this._audioSources [1];
        this._backgroundSound = this._audioSources [0];

        // Background Sound Play
        this._backgroundSound.Play();

        // place the hero in the starting position
        this._spawn();
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        //initialise public instance variables
        this.velocityRange = new VelocityRange(700f, 5000f);
        this.moveForce     = 800;
        this.jumpForce     = 26000f;

        //initialise private instance variables
        this._transform   = gameObject.GetComponent <Transform> ();
        this._animator    = gameObject.GetComponent <Animator> ();
        this._rigidBody2D = gameObject.GetComponent <Rigidbody2D> ();
        this._move        = 0f;
        this._jump        = 0f;
        this._facingRight = true;

        //audio sources
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._jumpSound    = this._audioSources [0];
        this._coinSound    = this._audioSources [1];
        this._deathSound   = this._audioSources [2];
        this._enemyDeath   = this._audioSources [3];

        //place the hero to the starting position
        this._spawn(-400, 200, 0);
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        // Initialize Public Instance Variables
        this.velocityRange = new VelocityRange(300f, 30000f);



        // Intitialize Private Instance Variable
        this._transform   = gameObject.GetComponent <Transform>();
        this._animator    = gameObject.GetComponent <Animator>();
        this._rigidBody2D = gameObject.GetComponent <Rigidbody2D>();
        this._move        = 0f;
        this._jump        = 0f;
        this._facingRight = true;
        ////Set default animation state to "idle"
        //this._animator.SetInteger("AnimState", 0);


        // Setup AudioSources
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._jumpSound    = this._audioSources[0];
        this._pickupSound  = this._audioSources[1];
        this._DeadSound    = this._audioSources[2];
        this._hurtSound    = this._audioSources[3];
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        //Initialize public instance variables
        this.velocityRange = new VelocityRange(300f, 10000f);


        //set private instance variables
        this._animator    = gameObject.GetComponent <Animator>();
        this._transform   = gameObject.GetComponent <Transform>();
        this._rigidBody2d = gameObject.GetComponent <Rigidbody2D>();
        this._move        = 0f;
        this._facingRight = true;

        this.curHealth = this.maxHealth;

        // Setup AudioSources
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._coinSound    = this._audioSources[0];
        this._deadSound    = this._audioSources[1];
        this._gameClear    = this._audioSources[2];
        this._gameover     = this._audioSources[3];
        this._hurtSound    = this._audioSources[4];
        this._backSound    = this._audioSources[5];
        this._jumpSound    = this._audioSources[6];
        this._powerUpSound = this._audioSources[7];

        this.GameoverUI.SetActive(false);

        this._animator.SetBool("isTouchedSpring", false);
    }
Esempio n. 5
0
 internal override void Write(EndianBinaryWriter writer)
 {
     base.Write(writer);
     KeyRange.Write(writer);
     VelocityRange.Write(writer);
     writer.Write(Options);
     writer.Write(KeyGroup);
     writer.Write(Layer);
 }
Esempio n. 6
0
        /// <summary>
        /// Creates a new AudioInteractionResult from the given IInteractionData.
        /// </summary>
        /// <param name="interactionData">The data to use to create the result.</param>
        /// <returns>A new AudioInteractionResult.</returns>
        public override IInteractionResult GetInteractionResult <T>(T interactionData)
        {
            //Immediately break out if intensity is less than the velocity range minimum, since any result would be invalid anyways.
            float intensity = ImpactInteractionUtilities.GetCollisionIntensity(interactionData, CollisionNormalInfluence);

            if (intensity < VelocityRange.Min)
            {
                return(null);
            }

            long key = 0;

            if (!ImpactInteractionUtilities.GetKeyAndValidate(interactionData, this, out key))
            {
                return(null);
            }

            AudioInteractionResult c;

            if (ImpactManagerInstance.TryGetInteractionResultFromPool(interactionResultPoolKey, out c))
            {
                c.OriginalData        = InteractionDataUtilities.ToInteractionData(interactionData);
                c.LoopAudio           = interactionData.InteractionType != InteractionData.InteractionTypeCollision;
                c.Interaction         = this;
                c.AudioSourceTemplate = AudioSourceTemplate;

                if (interactionData.InteractionType == InteractionData.InteractionTypeSimple)
                {
                    c.AudioClip = getAudioClip(interactionData.InteractionType, 0);
                    c.Volume    = RandomVolumeRange.RandomInRange();
                }
                else
                {
                    float normalizedIntensity = VelocityRange.Normalize(intensity);

                    c.AudioClip = getAudioClip(interactionData.InteractionType, normalizedIntensity);
                    c.Volume    = getVolume(normalizedIntensity) * interactionData.CompositionValue;
                    c.Key       = key;
                }

                c.Pitch = RandomPitchRange.RandomInRange();

                return(c);
            }

            return(null);
        }
    // Use this for initialization
    void Start()
    {
        this.velocityRange = new VelocityRange(300f, 1000f);
        this._rigidBody2D  = gameObject.GetComponent <Rigidbody2D>();
        this._transform    = gameObject.GetComponent <Transform>();
        //        this._animator = gameObject.GetComponent<Animator>();

        //this.moveForce = 50f;
        //this.jumpForce = 350f;
        this._isFacingRight = true;

        //place coolGuy in starting position
        this._spawn();

        this._audioSources = gameObject.GetComponents <AudioSource> ();
        this._coinSound    = this._audioSources[0];
        this._jumpSound    = this._audioSources[1];
    }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        // Instantiate public variable
        this.velocityRange = new VelocityRange(300f, 30000f);

        // Instantiate private variable
        this._transform      = gameObject.GetComponent <Transform>();
        this._rigidbody2D    = gameObject.GetComponent <Rigidbody2D> ();
        this._marioAnimator  = gameObject.GetComponent <Animator> ();
        this._horizontalMove = 0f;
        this._verticalMove   = 0f;
        this._marioAnimator.SetInteger("AnimState", 0);
        this._moveLeft = true;

        // Add Audio Source
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._jumpSound    = this._audioSources [0];
        this._coinSound    = this._audioSources [1];
    }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        //INTIALIZE PUBLIC INSTANCE VARIABLES
        this.velocityRange = new VelocityRange(300f, 1000f);

        //INTIALIZE PRIVATE INSTANCE VARIABLES
        this._transform    = gameObject.GetComponent <Transform>();
        this._anim         = gameObject.GetComponent <Animator>();
        this._rigidBody2D  = gameObject.GetComponent <Rigidbody2D>();
        this._move         = 0f;
        this._jump         = 0f;
        this.moveForce     = 1000f;
        this.jumpForce     = 30000f;
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._jumpSound    = this._audioSources[0];
        this._coinSound    = this._audioSources[3];
        this._clearLevel   = this._audioSources[1];
        this._fall         = this._audioSources[2];
        this._spawn();
    }
	// Use this for initialization
	void Start () {
		this.velocityRange = new VelocityRange (300f, 20000f);



		this._transform = gameObject.GetComponent<Transform> ();
		this._animator = gameObject.GetComponent<Animator> ();
		this._rigidBody2D=gameObject.GetComponent<Rigidbody2D> ();
		this._move = 0f;
		this._jump = 0f;
		this._facingRight = true;

		//Setup audiosources
		this._audioSources=gameObject.GetComponents<AudioSource>();
		this._jumpSound = this._audioSources [0];
		this._bananaSound = this._audioSources [1];
		this._enemySound = this._audioSources [2];
		//place the girl in the correct position
		this._spawn ();
	}
Esempio n. 11
0
    // Use this for initialization
    void Start()
    {
        // Initialize Public Instance Variables
        this.velocityRange = new VelocityRange(300f, 30000f);

        this._transform   = gameObject.GetComponent <Transform> ();
        this._animator    = gameObject.GetComponent <Animator> ();
        this._rigidBody2D = gameObject.GetComponent <Rigidbody2D>();
        this._move        = 0f;
        this._jump        = 0f;
        this._facingRight = true;

        //initialising the sounds
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._enemySound   = this._audioSources[1];
        this._rewardSound  = this._audioSources[2];
        this._winSound     = this._audioSources[3];

        // place the hero in the starting position
        this._spawn();
    }
Esempio n. 12
0
    // Use this for initialization
    void Start()
    {
        //initialize public variables
        velocityRange = new VelocityRange(1000f, 55000f);

        //initialize private variables
        transform   = gameObject.GetComponent <Transform> ();
        animator    = gameObject.GetComponent <Animator> ();
        rigidBody2d = gameObject.GetComponent <Rigidbody2D> ();
        move        = 0f;
        jump        = 0f;
        facingRight = true;

        //Audio Sources
        audioSources = gameObject.GetComponents <AudioSource>();
        coinSound    = audioSources [0];
        hurtSound    = audioSources [1];
        jumpSound    = audioSources [2];

        //player in start position
        spawn();
    }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        //PUBLIC VARIABLES
        this.velocityRange = new VelocityRange(200f, 210f);

        //PRIVATE VARIABLES
        this._transform   = gameObject.GetComponent <Transform>();
        this._animator    = gameObject.GetComponent <Animator>();
        this._rigidBody2d = gameObject.GetComponent <Rigidbody2D>();
        this._move        = 0f;
        this._jump        = 0f;
        this._facingRight = true;

        //SETUP AUDIO SOURCES
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._jumpSound    = this._audioSources[0];
        this._diamondSound = this._audioSources[1];
        this._hurtSound    = this._audioSources[2];

        // PLACE HERO ON CORRECT POSITION
        this._spawn();
    }
Esempio n. 14
0
    // Use this for initialization
    void Start()
    {
        //initialise public instance variables
        this.velocityRange = new VelocityRange(700f, 5000f);
        this.moveForce     = 800;
        this.jumpForce     = 26000f;

        //initialise private instance variables
        this._transform     = gameObject.GetComponent <Transform> ();
        this._animator      = gameObject.GetComponent <Animator> ();
        this._rigidBody2D   = gameObject.GetComponent <Rigidbody2D> ();
        this._move          = 0f;
        this._jump          = 0f;
        this._facingRight   = true;
        this.floatPositions = new Vector3[3];

        //audio sources
        this._audioSources = gameObject.GetComponents <AudioSource>();
        this._jumpSound    = this._audioSources [0];
        this._coinSound    = this._audioSources [1];
        this._deathSound   = this._audioSources [2];
        this._enemyDeath   = this._audioSources [3];
        this._powerUpSound = this._audioSources[4];

        if (SceneManager.GetActiveScene().buildIndex == 4)
        {
            this._gameLastSceneSound = this._audioSources[5];
            this._gameSuspenseSound  = this._audioSources[6];
        }

        this.getPosition();
        if (SceneManager.GetActiveScene().buildIndex == 3 || SceneManager.GetActiveScene().buildIndex == 4)
        {
        }
        else
        {
            //this._spawn(-374f, 550f, 0f);
        }
    }
    // Use this for initialization
    void Start()
    {
        //Initialize public instance variables
        this.velocityRange = new VelocityRange(300f, 10000f);

        //set private instance variables
        this._animator = gameObject.GetComponent<Animator>();
        this._transform = gameObject.GetComponent<Transform>();
        this._rigidBody2d = gameObject.GetComponent<Rigidbody2D>();
        this._move = 0f;
        this._facingRight = true;

        this.curHealth = this.maxHealth;

        // Setup AudioSources
        this._audioSources = gameObject.GetComponents<AudioSource>();
        this._jumpSound = this._audioSources[0];
        this._powerUpSound = this._audioSources[1];
        this._deadSound = this._audioSources[2];
        this._hurtSound = this._audioSources[3];
        this._coinSound = this._audioSources[4];
        this._gameover = this._audioSources[5];
        this._backSound = this._audioSources[6];
        this._gameClear = this._audioSources[7];

        this.GameoverUI.SetActive(false);
    }
    // Use this for initialization
    void Start()
    {
        // Initialize Public Instance Variables
        this.velocityRange = new VelocityRange(300f, 400f);

        // Initialize Private Instance Variables
        this._transform = gameObject.GetComponent<Transform>();
        this._animator = gameObject.GetComponent<Animator>();
        this._rigidBody2D = gameObject.GetComponent<Rigidbody2D>();
        this._move = 0f;
        this._jump = 0f;
        this._facingRight = true;

        // Setup AudioSources
        this._audioSources = gameObject.GetComponents<AudioSource>();
        this._jumpSound = this._audioSources[0];
        this._coinSound = this._audioSources[1];
        this._hurtSound = this._audioSources[2];

        // place the hero in the starting position
        this._spawn001();
    }
    // Use this for initialization
    void Start()
    {
        this._transform = gameObject.GetComponent<Transform>();

        //Intialize public variable
        this.velocityRange = new VelocityRange(300f, 30000f);
        this.moveForce = 1000f;
        this.jumpForce = 25000f;

        //Intialize private variable
        this._transform = gameObject.GetComponent<Transform>();
        this._animator = gameObject.GetComponent<Animator>();
        this._rigidbody2D = gameObject.GetComponent<Rigidbody2D>();
        this._move = 0f;
        this._jump = 0f;
        this._facingRight = true;

        // Setup AudioSources
        this._audioSources = gameObject.GetComponents<AudioSource>();

        this._hurtSound = this._audioSources[0];
        this._jumpSound = this._audioSources[1];
        this._potionSound = this._audioSources[2];

        // place the hero in the starting position
        this._spawn();
    }