Commit d8a4c403 authored by nedboy3's avatar nedboy3
Browse files

Now Mime Mime has a tutorial stage, still needs to be triggered.

parent fa490d49
Bavaria 8
left 0
up 2.85
down 4.45
right 5.7
up 3000
\ No newline at end of file
fileFormatVersion: 2
guid: 2e8db8bb98880c14d945d985f97ce0c9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: ffadb8f7d43b9bc4bbba7bfba7beb669
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -90,7 +90,11 @@ public class SilasSpeech : MonoBehaviour, Character {
conversation.Clear();
responseQueue.Clear();
if (GameManager.ConversationStage == 1) {
if (GameManager.SilasTutorial)
{
loadTutorialConversation();
}else if (GameManager.ConversationStage == 1) {
conversationStage1();
} else if (GameManager.ConversationStage == 2) {
......@@ -168,4 +172,49 @@ public class SilasSpeech : MonoBehaviour, Character {
conversation.Enqueue("Stage 4 conversation stuff 2");
responseQueue.Enqueue(new string[] { "Stage 4 response 1", "stage 4 resposne 2" });
}
private void loadTutorialConversation()
{
conversation.Enqueue("Oh hey, so nice of you to come perform with me!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("We're gonna have so much fun!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("Or at least, I'll have so much fun!");
responseQueue.Enqueue(new string[] { "Get on with it" });
conversation.Enqueue("All you have to do to perform with me is dance, for me it's pretty natural!");
responseQueue.Enqueue(new string[] { "I don't know how" });
conversation.Enqueue("but if it wasn't natural I'd know that anyone can use the Q W E or R keys to daaaaannceee.");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("WOW, your dancing is so good it made fireworks in those convenient looking boxes!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("How about I let you know what amazing moves I'm going to do? And you can copy me!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("I'll use my super secret mime sign language by sending instructions from those mimetastic pillars to your right. Ready?!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("Here I go, hit it when it's in it's square, I'll go easy this time!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("Hit it now!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("Nice job!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("let's try a few more of my definitely different moves!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("This time I've gotta go fast, you can do it!");
responseQueue.Enqueue(new string[] { "okay" });
conversation.Enqueue("I think you've got the idea now! Time for us to do this for real!");
responseQueue.Enqueue(new string[] { "okay" });
}
}
......@@ -17,7 +17,11 @@ public class GameManager : MonoBehaviour {
public static bool SimonTutorial;
public static bool JohnTutorial;
public static bool SilasTutorial;
public static bool SilasNoteInPlace = false;
public static bool PlayerCanDance = true;
public static int TutorialState;
public static int ConversationStage;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class MimeMimeTutorial : MonoBehaviour
{
public GameObject dialogueBox;
public Camera faceCam;
public Text SilasText;
public GameObject silas;
public SilasSpeech speech;
public Button button;
public SpawnKeys spawner;
public AudioSource music;
private int state;
private void Start()
{
GameManager.SilasTutorial = true;
dialogueBox.SetActive(false);
speech = silas.GetComponent<SilasSpeech>();
print(speech.GreetingMessage());
SilasText.text = speech.converse();
StartCoroutine(noticePlayer());
}
private void Update()
{
if ((Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.R)) && GameManager.TutorialState == 1)
{
progress();
}
if (GameManager.TutorialState == 3 && GameManager.SilasNoteInPlace)
{
progress();
}
if (Input.GetKeyDown(KeyCode.Q) && GameManager.TutorialState == 4)
{
progress();
Time.timeScale = 1f;
music.Play();
GameManager.SilasNoteInPlace = false;
StartCoroutine(freezetime());
}
}
private IEnumerator freezetime()
{
yield return new WaitForSeconds(1f);
Time.timeScale = 0f;
progress();
music.Pause();
}
private IEnumerator finish()
{
yield return new WaitForSeconds(5f);
progress();
}
private IEnumerator noticePlayer()
{
yield return new WaitForSeconds(3);
dialogueBox.SetActive(true);
faceCam.gameObject.SetActive(true);
StopCoroutine(noticePlayer());
}
public void ButtonPress()
{
progress();
}
void progress()
{
state++;
if (state == 4)
{
button.gameObject.SetActive(false);
GameManager.TutorialState = 1;
}
else if (state == 5)
{
button.gameObject.SetActive(true);
GameManager.TutorialState = 2;
}
else if(state == 8)
{
button.gameObject.SetActive(false);
GameManager.TutorialState = 3;
spawner.startTutorial();
GameManager.PlayerCanDance = false;
}
else if (state == 9)
{
button.gameObject.SetActive(false);
GameManager.PlayerCanDance = true;
GameManager.TutorialState = 4;
}
else if (state == 11)
{
button.gameObject.SetActive(true);
}
else if (state == 12)
{
button.gameObject.SetActive(false);
Time.timeScale = 1f;
music.Play();
StartCoroutine(finish());
}
else if (state == 13)
{
button.gameObject.SetActive(true);
music.volume = 0.05f;
}
else if (state == 14)
{
SceneManager.LoadScene("MimeMime");
}
SilasText.text = speech.converse();
}
}
fileFormatVersion: 2
guid: bdbe304d758dbe549bf10ed4554cf78f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -31,9 +31,13 @@ public class SpawnKeys : MonoBehaviour {
// Use this for initialization
void Start () {
}
public void startTutorial()
{
songSet = true;
StartCoroutine(tutorialpause());
}
//plays the song after the first arrow reaches a barrier.
private IEnumerator playSong(AudioClip musicClip, float waitTime){
yield return new WaitForSeconds(waitTime);
......@@ -57,6 +61,17 @@ public class SpawnKeys : MonoBehaviour {
tester.SilasDance(arrow);
}
private IEnumerator tutorialpause()
{
yield return new WaitForSeconds(2.1f);
print("Something" + songWaitTime);
Time.timeScale = 0f;
music.Pause();
GameManager.SilasNoteInPlace = true;
}
void Update () {
if(songSet == true){
levelManager = GetComponent<LevelManager>();
......@@ -95,7 +110,7 @@ public class SpawnKeys : MonoBehaviour {
StartCoroutine(playSong(songAudio, songWaitTime));
songSet = false;
}
if(endSong == true){
if(endSong == true && music != null){
music.volume -= (volumeFade * Time.deltaTime);
}
while (nextKey != null && Time.time > startTime + float.Parse(nextKey[1]) - skip)
......
......@@ -47,37 +47,40 @@ public class TriggerManager : MonoBehaviour
void Update()
{
//Check which key the player presses
if (Input.GetKeyDown(KeyCode.Q) || Input.GetKeyDown(KeyCode.A))
if (GameManager.PlayerCanDance)
{
moveColliders((int)keys.left);
Vector3 newScale = player.transform.localScale;
newScale.x = -2;
player.transform.localScale = newScale;
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.R) || Input.GetKeyDown(KeyCode.D))
{
moveColliders((int)keys.right);
Vector3 newScale = player.transform.localScale;
newScale.x = 2;
player.transform.localScale = newScale;
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.W))
{
moveColliders((int)keys.up);
Vector3 newPos = player.transform.position;
newPos.y = -1;
player.transform.position = newPos;
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.S))
{
moveColliders((int)keys.down);
Vector3 newPos = player.transform.position;
newPos.y = -1.3f;
player.transform.position = newPos;
checkLowestKey();
if (Input.GetKeyDown(KeyCode.Q))
{
moveColliders((int)keys.left);
Vector3 newScale = player.transform.localScale;
newScale.x = -2;
player.transform.localScale = newScale;
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.R))
{
moveColliders((int)keys.right);
Vector3 newScale = player.transform.localScale;
newScale.x = 2;
player.transform.localScale = newScale;
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.W))
{
moveColliders((int)keys.up);
Vector3 newPos = player.transform.position;
newPos.y = -1;
player.transform.position = newPos;
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.E))
{
moveColliders((int)keys.down);
Vector3 newPos = player.transform.position;
newPos.y = -1.3f;
player.transform.position = newPos;
checkLowestKey();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment