mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
feat: dynamically create elements levels (#39)
This commit is contained in:
@ -10,7 +10,6 @@ public class Player : MonoBehaviour
|
||||
public LevelsLoader levelsLoader;
|
||||
|
||||
public bool isColliding = true;
|
||||
public AudioSource audioSource;
|
||||
private bool hasStarted = false;
|
||||
|
||||
private bool canJump = true;
|
||||
@ -18,10 +17,6 @@ public class Player : MonoBehaviour
|
||||
public void Start()
|
||||
{
|
||||
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
|
||||
levelsLoader.IncreaseTotalAttempts();
|
||||
|
||||
audioSource.clip = Resources.Load<AudioClip>(Path.Combine("Musics", levelsLoader.levelCurrent.musicName));
|
||||
audioSource.Play();
|
||||
|
||||
var mainModule = particle.main;
|
||||
mainModule.simulationSpace = ParticleSystemSimulationSpace.World;
|
||||
@ -56,7 +51,6 @@ public class Player : MonoBehaviour
|
||||
}
|
||||
|
||||
UpdateParticlePositionAndRotation();
|
||||
UpdateParticleSystemSpeed();
|
||||
}
|
||||
|
||||
private void Jump()
|
||||
@ -84,12 +78,6 @@ public class Player : MonoBehaviour
|
||||
particle.transform.rotation = Quaternion.Euler(0, 0, 150.464f);
|
||||
}
|
||||
|
||||
private void UpdateParticleSystemSpeed()
|
||||
{
|
||||
var velocityOverLifetime = particle.velocityOverLifetime;
|
||||
velocityOverLifetime.x = rigidBody.linearVelocity.x;
|
||||
}
|
||||
|
||||
public void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
isColliding = true;
|
||||
|
Reference in New Issue
Block a user