update stuff
This commit is contained in:
@@ -60,7 +60,14 @@ public class dragoncontrols : MonoBehaviour
|
||||
//add rotation from ziput
|
||||
//transform.Rotate(0, zinput * Time.deltaTime * rotspeed, xrot * Time.deltaTime / 2 * rotspeed);
|
||||
//set rotation from ziput addforce
|
||||
//Vector3 m_EulerAngleVelocity = new Vector3(0, yrot * Time.fixedDeltaTime * rotspeed, xrot * Time.fixedDeltaTime / 2 * rotspeed);
|
||||
//make the rotation slower
|
||||
//m_EulerAngleVelocity *= 0.1f;
|
||||
Vector3 m_EulerAngleVelocity = new Vector3(0, yrot * Time.fixedDeltaTime * rotspeed, xrot * Time.fixedDeltaTime / 2 * rotspeed);
|
||||
//slow the rotation
|
||||
m_EulerAngleVelocity *= 0.3f;
|
||||
//add the rotation
|
||||
rb.AddTorque(m_EulerAngleVelocity);
|
||||
Quaternion deltaRotation = Quaternion.Euler(m_EulerAngleVelocity * Time.fixedDeltaTime);
|
||||
rb.MoveRotation(deltaRotation);
|
||||
}
|
||||
|
@@ -31,6 +31,10 @@ public class enemykiller : MonoBehaviour
|
||||
{
|
||||
text.text = "Score: " + score + "\nHighscore: " + highscore + "\nLives: " + lives + "\nKings remaining: " + GameObject.FindGameObjectsWithTag("king").Length + "\nEnemies remaining: " + GameObject.FindGameObjectsWithTag("enemy").Length;;
|
||||
}
|
||||
}
|
||||
void OnSoundEnd()
|
||||
{
|
||||
|
||||
}
|
||||
//on particle coolision
|
||||
void OnParticleCollision(GameObject otherx)
|
||||
@@ -48,7 +52,12 @@ public class enemykiller : MonoBehaviour
|
||||
}
|
||||
if (other.tag == "enemy")
|
||||
{
|
||||
Destroy(other);
|
||||
//play sound from enemy
|
||||
other.GetComponent<AudioSource>().Play();
|
||||
//turn off collider
|
||||
other.GetComponent<Collider>().enabled = false;
|
||||
//turn off renderer
|
||||
other.GetComponent<Renderer>().enabled = false;
|
||||
Debug.Log("enemy killed (" + other.name+ ")");
|
||||
//increase score
|
||||
score++;
|
||||
@@ -60,7 +69,12 @@ public class enemykiller : MonoBehaviour
|
||||
}
|
||||
if (other.tag == "king")
|
||||
{
|
||||
Destroy(other);
|
||||
//play sound from enemy
|
||||
other.GetComponent<AudioSource>().Play();
|
||||
//turn off collider
|
||||
other.GetComponent<Collider>().enabled = false;
|
||||
//turn off renderer
|
||||
other.GetComponent<Renderer>().enabled = false;
|
||||
Debug.Log("killed king" + other.name);
|
||||
//decrease score
|
||||
score-= 20;
|
||||
|
Reference in New Issue
Block a user