Skip to content

Commit

Permalink
added co-rountine (incomplete)
Browse files Browse the repository at this point in the history
  • Loading branch information
qcmx16 committed Oct 31, 2018
1 parent 6d4b77f commit 4e7c322
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 245 deletions.
40 changes: 35 additions & 5 deletions Blockade/Assets/Blockade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ public class Blockade : MonoBehaviour {
public TextMesh s1;
public TextMesh s2;

public Sprite green;
public Sprite black;
public static Sprite green;
public static Sprite black;

public Vector3 direction;
public Vector3 direction2;
public Vector3 current;
public Vector3 current2;
public static Vector3 current;
public static Vector3 current2;

public int score1;
public int score2;


public float timer = 0f;

GameObject[,] grid = new GameObject[100, 100];
static GameObject[,] grid = new GameObject[100, 100];


// Use this for initialization
Expand Down Expand Up @@ -158,4 +158,34 @@ void gameOver(int s)

bkgd.Play();
}


IEnumerator gameoverTransition(int s);
{
for (int i = 0; i < 15; i++)
{
if(s == 1 && i % 3 == 0)
{
if ((grid[(int) current.x, (int) current.y].GetComponent<SpriteRenderer>().sprite == green))
{
grid[(int) current.x, (int) current.y].GetComponent<SpriteRenderer>().sprite = black;
}
else
{
grid[(int) current.x, (int) current.y].GetComponent<SpriteRenderer>().sprite = green;
}
}
else if(s == 2 && i % 3 == 0)
{
if ((grid[(int) current2.x, (int) current2.y].GetComponent<SpriteRenderer>().sprite == green))
{
grid[(int) current2.x, (int) current2.y].GetComponent<SpriteRenderer>().sprite = black;
}
else
{
grid[(int) current2.x, (int) current2.y].GetComponent<SpriteRenderer>().sprite = green;
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Blockade/Assets/Plugins/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Blockade/Assets/Plugins/Editor/JetBrains.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
237 changes: 0 additions & 237 deletions Blockade/Assets/Scenes/SampleScene.unity

This file was deleted.

3 changes: 2 additions & 1 deletion Blockade/ProjectSettings/EditorSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ EditorSettings:
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef
m_ProjectGenerationRootNamespace:
m_UserGeneratedProjectSuffix:
m_CollabEditorSettings:
inProgressEnabled: 1
m_EnableTextureStreamingInPlayMode: 1
2 changes: 1 addition & 1 deletion Blockade/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
m_EditorVersion: 2018.2.7f1
m_EditorVersion: 2018.2.8f1

0 comments on commit 4e7c322

Please sign in to comment.