Update 4
This commit is contained in:
@@ -39,16 +39,7 @@ public class dragoncontrols : MonoBehaviour
|
||||
//control flames
|
||||
if (flamethrover)
|
||||
{
|
||||
//if not playing
|
||||
if (!flames.isPlaying)
|
||||
{
|
||||
//play flames
|
||||
flames.Play();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flames.Stop();
|
||||
flames.Emit(1);
|
||||
}
|
||||
//move relative to camera
|
||||
//transform.Translate(xinput * Time.deltaTime * 4, yinput * Time.deltaTime * 4, zinput * Time.deltaTime);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
//include textmeshpro
|
||||
using TMPro;
|
||||
|
||||
@@ -14,6 +15,8 @@ public class enemykiller : MonoBehaviour
|
||||
public int score = 0;
|
||||
public int highscore = 0;
|
||||
public int lives = 12;
|
||||
//array of killed gameobjects
|
||||
public List<GameObject> killed = new List<GameObject>();
|
||||
void Start()
|
||||
{
|
||||
part = GetComponent<ParticleSystem>();
|
||||
@@ -50,6 +53,12 @@ public class enemykiller : MonoBehaviour
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
//check if object in killed list
|
||||
if (killed.Contains(other))
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (other.tag == "enemy")
|
||||
{
|
||||
//play sound from enemy
|
||||
@@ -58,6 +67,8 @@ public class enemykiller : MonoBehaviour
|
||||
other.GetComponent<Collider>().enabled = false;
|
||||
//turn off renderer
|
||||
other.GetComponent<Renderer>().enabled = false;
|
||||
//add object to killed
|
||||
killed.Add(other);
|
||||
Debug.Log("enemy killed (" + other.name+ ")");
|
||||
//increase score
|
||||
score++;
|
||||
@@ -75,6 +86,8 @@ public class enemykiller : MonoBehaviour
|
||||
other.GetComponent<Collider>().enabled = false;
|
||||
//turn off renderer
|
||||
other.GetComponent<Renderer>().enabled = false;
|
||||
//add object to killed
|
||||
killed.Add(other);
|
||||
Debug.Log("killed king" + other.name);
|
||||
//decrease score
|
||||
score-= 20;
|
||||
|
Reference in New Issue
Block a user