This commit is contained in:
Tommy Parnell
2015-04-12 22:33:50 -04:00
commit ff3692e87a
155 changed files with 7148 additions and 0 deletions

28
Assets/Scripts/Wall.cs Normal file
View File

@@ -0,0 +1,28 @@
using UnityEngine;
using System.Collections;
public class Wall : MonoBehaviour
{
public Sprite dmgSprite;
public int Hp = 4;
private SpriteRenderer spriteRenderer;
public AudioClip chopSound1;
public AudioClip chopSound2;
void Awake()
{
spriteRenderer = GetComponent<SpriteRenderer>();
}
public void DamageWall(int loss)
{
SoundManager.instance.RandomizeSfx(chopSound1, chopSound2);
spriteRenderer.sprite = dmgSprite;
Hp -= loss;
if (Hp <= 0)
{
gameObject.SetActive(false);
}
}
}