예제 #1
0
 protected virtual void CreateWeapon()
 {
     weaponGO      = Instantiate(Weapon, gameObject.transform);
     weapon        = weaponGO.GetComponent <WeaponEnemy>();
     weapon.Cursor = Cursor;
     weaponGO.SetActive(false);
 }
예제 #2
0
    void Start()
    {
        arcade = GetComponent <EnemyArcade>();
        we     = GetComponent <WeaponEnemy>();

        arcade.enabled = true;
        we.enabled     = true;
    }
예제 #3
0
    public GameObject explosion; //bypassed; added hellfire explosion particles from resource folder.
    //private int srLayer; //removed due to not having any effect. somehow.

    //weapon use


    // Use this for initialization
    void Start () {
        rb = GetComponent<Rigidbody2D>();
        wep = weapon.GetComponent<WeaponEnemy>();
        wepScript = weapon.GetComponent<SnekMultiGun>(); //could just shoot using this. but ah well.
        SetUpSparks(); //copied from Enemy.cs
        targetA = new Vector2(1, 4);//set some initial targets; for testing moving onto the screen.
        targetB = new Vector2(-4, 0);
        targetC = new Vector2(1, -4); //this will be overwritten by the generator immediately btw. testing with invalid
        pTransform = GameObject.FindGameObjectWithTag("Player").transform;
        targetP = pTransform.position;
        headTransform = headScript.GetComponent<Transform>();
        canShoot = false;
        wepIDs = new List<string>();
        explosionParticles = GameObject.Find("Hellfire Explosion Deluxe");


        currentTargetNo = 1;//start by going for target 1/a.
        currentTarget = targetA;

        acquiringTarget = true; //these should always be the inverse of eachother, and therefore we don't need 2...
        snekking = false; //but having both could help, and certainly helps when reading.
        invulnerable = false;

        speed = 2.0f; //movement speed
        speedMultiplier = 1.0f; //MS multiplier. apply when missing segments, from 1 to ~2.

        normalMovement = false;
        turningLeft = true;
        snekkingMaxAngle = 40.0f;
        snekkingAngle = snekkingMaxAngle / 2;
        turnSpeed = 60.0f;

        
        //aesthetics
        sr = GetComponent<SpriteRenderer>();
        srShield = GetComponentsInChildren<SpriteRenderer>()[1];
        srShield.enabled = true;
        srShield.sortingOrder = sr.sortingOrder + 1;
        srShield.enabled = false;
        //if this doesnt work, come back, enable the renderer, change value, then disable.

        if (Global.Difficulty == Global.RECRUIT) {
            lerpSpeed = 0.5f;
            healthMax = 25.0f;
        }
        else if (Global.Difficulty == Global.VETEREN) {
            lerpSpeed = 0.75f;
            healthMax = 25.0f;
        }
        else if (Global.Difficulty == Global.BATTLEH) {
            lerpSpeed = 1.0f;
            healthMax = 25.0f;
        }
        health = healthMax;
        damageReceivedMultiplier = 1;
        SetHeadTransform();
    }
예제 #4
0
    //Spawn a Pipe and make it rain Minus
    void Minusregen()
    {
        Vector3 pos = new Vector3(36.5f, -22f, 0f);

        Instantiate(pipe, pos, Quaternion.Euler(0, 0, 90));//Pipe erzeugen und binden
        pipe             = GameObject.Find("Pipe(Clone)");
        pipeWeaponScript = (WeaponEnemy)pipe.GetComponent(typeof(WeaponEnemy));
        //pipeWeaponScript.PipeSpam();//Spam auslösen
        Score.blussiSave = Score.blussi;//Blussi Count für Später speichern

        playerMovement      = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();
        playerMovement.move = false;                                              //Spieler temporär unbeweglich machen
        eventbool           = true;                                               //Fixed Update aktivieren
        playerMovement.controller.Move(0.1f * Time.fixedDeltaTime, false, false); //Nach rechts drehen
        playerMovement.horizontalMove = 0;
    }
예제 #5
0
 // Start is called before the first frame update
 void Start()
 {
     weapon         = GetComponent <WeaponEnemy>();
     target         = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();
     weapon.enabled = false;
 }
예제 #6
0
 private void Start()
 {
     armaInamic  = GameObject.FindGameObjectWithTag("Enemy").GetComponent <WeaponEnemy>();
     currentLife = startingLife;
 }