mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
feat(ui): music + background (#30)
This commit is contained in:
@ -4,6 +4,7 @@ public class Obstacle : MonoBehaviour
|
||||
{
|
||||
public PlayerScript playerScript;
|
||||
public GameObject playerObject;
|
||||
public AudioSource audioSource;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
@ -19,5 +20,6 @@ public class Obstacle : MonoBehaviour
|
||||
{
|
||||
playerObject.transform.rotation = playerScript.initialRotation;
|
||||
playerObject.transform.position = playerScript.initialPosition;
|
||||
playerScript.audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ public class PlayerScript : MonoBehaviour
|
||||
|
||||
private bool wantsToJump = false;
|
||||
|
||||
public AudioSource audioSource;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
initialPosition = transform.position;
|
||||
@ -78,7 +80,7 @@ public class PlayerScript : MonoBehaviour
|
||||
|
||||
private void UpdateParticlePositionAndRotation()
|
||||
{
|
||||
particle.transform.position = transform.position + new Vector3(-0.19f, -0.64f, 0);
|
||||
particle.transform.position = transform.position + new Vector3(-0.19f, -0.64f, -10);
|
||||
particle.transform.rotation = Quaternion.Euler(0, 0, 150.464f);
|
||||
}
|
||||
|
||||
|
@ -19,5 +19,6 @@ public class SpikeScript : MonoBehaviour
|
||||
{
|
||||
playerObject.transform.rotation = playerScript.initialRotation;
|
||||
playerObject.transform.position = playerScript.initialPosition;
|
||||
playerScript.audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user