Commit ba831b43 authored by gstuitje's avatar gstuitje
Browse files

Now Simon and the player "dance", also added an arrow sheath.

parent 7029adbb
<Properties StartupConfiguration="{67A4F128-F6AC-CD88-DA35-F29416A0792A}|">
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp PreferredExecutionTarget="Unity.Editor" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/LevelManager.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/TriggerManager.cs">
<Files>
<File FileName="Assets/Scripts/SpawnKeys.cs" Line="98" Column="33" />
<File FileName="Assets/Scripts/SpawnKeys.cs" Line="99" Column="66" />
<File FileName="Assets/Scripts/DaytimeScripts/DaytimeManager.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/LevelManager.cs" Line="22" Column="9" />
<File FileName="Assets/Scripts/TriggerManager.cs" Line="1" Column="1" />
<File FileName="Assets/Scripts/TestTrigger.cs" Line="1" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
......
......@@ -74,9 +74,16 @@ public class SpawnKeys : MonoBehaviour {
yield return new WaitForSeconds(songWaitTime);
TriggerManager tester = GameObject.FindWithTag("TriggerManager").GetComponent<TriggerManager>();
tester.test(arrow);
}
void Update () {
}
private IEnumerator silasDance(string arrow)
{
yield return new WaitForSeconds(songWaitTime);
TriggerManager tester = GameObject.FindWithTag("TriggerManager").GetComponent<TriggerManager>();
tester.SilasDance(arrow);
}
void Update () {
if(endSong == true){
music.volume -= (volumeFade * Time.deltaTime);
}
......@@ -89,34 +96,39 @@ public class SpawnKeys : MonoBehaviour {
case "left":
//print("left");
Instantiate(arrowPrefab, new Vector3(5f, 4f, 1f), Quaternion.identity);
Instantiate(arrowPrefab, new Vector3(4.85f, 4f, 1f), Quaternion.identity);
if(ComputerCheck == true){
StartCoroutine(testNote("Left"));
}
}
StartCoroutine(silasDance("Left"));
break;
case "right":
//print("right");
Instantiate(arrowPrefab, new Vector3(8f, 4f, 1f), Quaternion.Euler(new Vector3(0, 0, 180)));
Instantiate(arrowPrefab, new Vector3(8.82f, 4f, 1f), Quaternion.Euler(new Vector3(0, 0, 180)));
if (ComputerCheck == true)
{
StartCoroutine(testNote("Right"));
}
StartCoroutine(silasDance("Right"));
break;
case "up":
//print("up");
Instantiate(arrowPrefab, new Vector3(6f, 4f, 1f), Quaternion.Euler(new Vector3(0, 0, 270)));
Instantiate(arrowPrefab, new Vector3(6.18f, 4f, 1f), Quaternion.Euler(new Vector3(0, 0, 270)));
if (ComputerCheck == true)
{
StartCoroutine(testNote("Up"));
}
StartCoroutine(silasDance("Up"));
break;
case "down":
//print("DOWN");
Instantiate(arrowPrefab, new Vector3(7f, 4f, 1f), Quaternion.Euler(new Vector3(0, 0, 90)));
Instantiate(arrowPrefab, new Vector3(7.51f, 4f, 1f), Quaternion.Euler(new Vector3(0, 0, 90)));
if (ComputerCheck == true)
{
StartCoroutine(testNote("Down"));
}
StartCoroutine(silasDance("Down"));
break;
default:
break;
......
......@@ -8,7 +8,8 @@ public class TriggerManager : MonoBehaviour
public Collider2D goodCollider;
public Collider2D badCollider;
public GameObject perfectRope;
private Transform player;
private Transform mime;
public GameObject perfectHit;
public GameObject goodHit;
......@@ -25,6 +26,8 @@ public class TriggerManager : MonoBehaviour
void Start()
{
filter.SetLayerMask(LayerMask.GetMask("Key"));
player = GameObject.FindWithTag("Player").transform;
mime = GameObject.FindWithTag("Silas").transform;
}
// Update is called once per frame
......@@ -34,20 +37,24 @@ public class TriggerManager : MonoBehaviour
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
moveColliders((int)keys.left);
player.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f));
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.RightArrow))
{
moveColliders((int)keys.right);
player.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 270f));
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.UpArrow))
{
player.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f));
moveColliders((int)keys.up);
checkLowestKey();
}
if (Input.GetKeyDown(KeyCode.DownArrow))
{
player.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 180f));
moveColliders((int)keys.down);
checkLowestKey();
}
......@@ -77,6 +84,28 @@ public class TriggerManager : MonoBehaviour
moveColliders((int)keys.down);
checkLowestKey();
}
}
public void SilasDance(string arrow)
{
//Check which key the player presses
if (arrow == "Left")
{
mime.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f));
}
if (arrow == "Right")
{
mime.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 270f));
}
if (arrow == "Up")
{
mime.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f));
}
if (arrow == "Down")
{
mime.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 180f));
}
}
void moveColliders(int key)
......@@ -109,7 +138,6 @@ public class TriggerManager : MonoBehaviour
{
MimeMime.PerfectHit(currentKey.GetComponent<Key>());
print("PERFECT");
perfectRope.GetComponent<SpriteRenderer>().color = Color.green;
Instantiate(perfectHit, currentKey.transform.position, currentKey.transform.rotation);
Destroy(currentKey);
}
......@@ -117,7 +145,6 @@ public class TriggerManager : MonoBehaviour
{
MimeMime.GoodHit(currentKey.GetComponent<Key>());
print("GOOD");
perfectRope.GetComponent<SpriteRenderer>().color = Color.yellow;
Instantiate(goodHit, currentKey.transform.position, currentKey.transform.rotation);
Destroy(currentKey);
}
......@@ -125,7 +152,6 @@ public class TriggerManager : MonoBehaviour
{
MimeMime.BadHit(currentKey.GetComponent<Key>());
print("Bad");
perfectRope.GetComponent<SpriteRenderer>().color = Color.red;
Instantiate(badHit, currentKey.transform.position, currentKey.transform.rotation);
Destroy(currentKey);
}
......
fileFormatVersion: 2
guid: 5d66dace2fd8349cf85e3eb8c79129dc
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 23a85a2d935bc42358163bfa463db28a
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
m_EditorVersion: 2018.2.11f1
m_EditorVersion: 2018.2.12f1
......@@ -13,6 +13,9 @@ TagManager:
- CharacterSpeech
- Manager
- ResponsePanel
- LevelMaster
- TriggerManager
- Silas
layers:
- Default
- TransparentFX
......
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