var boom8 : AudioClip;
function Start () {
}
function Update () {
transform.position.x += Input.GetAxis("Horizontal") * playerSpeed * Time.deltaTime;
if (transform.position.x > maxWidth)
transform.position.x = maxWidth;
if (transform.position.x < -maxWidth)
transform.position.x = -maxWidth;
if (Input.GetButtonDown("Jump"))
Instantiate(bullet, bulletSpawn.position, bulletSpawn.rotation);
if (Input.GetButtonDown("Quit"))
Application.Quit();
}
function OnTriggerEnter (other : Collider)
{
if (other.tag == "Enemy")
{
audio.PlayOneShot(boom8,0.9);
Instantiate (explosion, transform.position, transform.rotation);
Instantiate (Restarter, transform.position, transform.rotation);
Destroy (gameObject);
}
}