Exemple #1
0
    // Use this for initialization
    void Start()
    {
        // Get components
        body      = GetComponent <Rigidbody2D>();
        anim      = GetComponent <Animator>();
        Srenderer = GetComponent <SpriteRenderer>();

        // Set base params
        stats             = new Player_Stats();
        atkCharge         = 0.5f;
        ammo              = 100f;
        ammo_regen        = new Regen_Counter(0.3f, 0.2f);
        shieldRegenTime   = shieldMaxRegenTime;
        shieldRecoverTime = shieldMaxRecoverTime;

        // Create weapon object and make it follow you
        wep                  = (Weapon)Instantiate(weapon, body.position, transform.rotation);
        wep.stats            = stats;
        wep.transform.parent = transform;

        score = new ScoreBoard();

        spawnerCheck = 0;
        spawnerTime  = 10;
    }
Exemple #2
0
	// Use this for initialization
	void Start () {

		// Get components
		body = GetComponent<Rigidbody2D>();
		anim = GetComponent<Animator>();
		Srenderer = GetComponent<SpriteRenderer>();

		// Set base params
		stats = new Player_Stats();
		atkCharge = 0.5f;
		ammo = 100f;
		ammo_regen = new Regen_Counter(0.3f, 0.2f);
		shieldRegenTime = shieldMaxRegenTime;
		shieldRecoverTime = shieldMaxRecoverTime;

		// Create weapon object and make it follow you
		wep = (Weapon) Instantiate( weapon, body.position, transform.rotation );
		wep.stats = stats;
		wep.transform.parent = transform;

		score = new ScoreBoard();

		spawnerCheck = 0;
		spawnerTime = 10;
	}