Cutsceeens

This commit is contained in:
2021-07-24 12:38:43 +02:00
parent 1c5be0cda2
commit d739b54515
82 changed files with 36952 additions and 64 deletions

View File

@@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Intro_player : MonoBehaviour
{
public Animator animator;
public AudioSource sfx;
public AudioSource EngineSfx;
public ParticleSystem explosion;
public ParticleSystem engine;
public Rigidbody2D rb;
public bool crashed;
private void OnCollisionEnter2D (Collision2D collisionInfo)
{
if (collisionInfo.collider.name == "Planet") {
animator.SetBool("crashed", true);
crashed = true;
explosion.Play();
sfx.Play();
engine.Stop();
EngineSfx.Stop();
}
}
// Update is called once per frame
void Update()
{
Vector3 targetVelocity = rb.velocity;
if(!crashed){
targetVelocity[0] = 12f;
targetVelocity[1] = 0f;
}
else{
targetVelocity[0] = 0f;
targetVelocity[1] = 0f;
StartCoroutine(Example());
}
rb.velocity = targetVelocity;
}
IEnumerator Example()
{
yield return new WaitForSecondsRealtime(2);
SceneManager.LoadScene("Tutorial");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b6c1bdac27d30ce469e733fba929f79a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -23,7 +23,7 @@ public class MenuPlay : MonoBehaviour
if(Physics2D.CircleCast(mouse.pos, 1f, Vector2.zero, 0f, contactFilter)){
if (Input.GetMouseButtonDown(0)){
sfx.Play();
SceneManager.LoadScene("Tutorial");
SceneManager.LoadScene("Intro");
}
previous_hover = hover;

View File

@@ -0,0 +1,57 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Outro_Player : MonoBehaviour
{
public AudioSource enginesfx;
public ParticleSystem engine;
public Rigidbody2D rb;
public bool running = false;
// Start is called before the first frame update
void Start()
{
StartCoroutine(starting());
}
// Update is called once per frame
void Update()
{
Vector3 targetVelocity = rb.velocity;
if(running){
targetVelocity[0] = 0f;
targetVelocity[1] = 12f;
}
else{
targetVelocity[0] = 0f;
targetVelocity[1] = 0f;
}
rb.velocity = targetVelocity;
}
IEnumerator starting()
{
yield return new WaitForSecondsRealtime(3f);
engine.Play();
enginesfx.Play();
yield return new WaitForSecondsRealtime(1f);
engine.Stop();
enginesfx.Stop();
yield return new WaitForSecondsRealtime(3f);
engine.Play();
enginesfx.Play();
yield return new WaitForSecondsRealtime(2f);
engine.Stop();
enginesfx.Stop();
yield return new WaitForSecondsRealtime(3f);
engine.Play();
running = true;
enginesfx.Play();
yield return new WaitForSecondsRealtime(5f);
SceneManager.LoadScene("Finish");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ec2edaeb6f39a1941815b5026576c858
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -69,7 +69,7 @@ public class PlayerControls : MonoBehaviour
}
void FixedUpdate(){
controller.Move(horizonatalaxis * runspeed * 10f * Time.fixedDeltaTime, jumping);
controller.Move(horizonatalaxis * runspeed, jumping);
}
}