Commit
- Loading branch information
There are no files selected for viewing
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.
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.
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,45 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class Brick : MonoBehaviour { | ||
|
||
public GameObject GameMaster; | ||
|
||
public Score scoreScript; | ||
|
||
void Start() | ||
{ | ||
|
||
Score scoreScript = GameMaster.GetComponent<Score> (); | ||
|
||
} | ||
|
||
void OnCollisionEnter (Collision other){ | ||
//Score scoreScript = GameMaster.GetComponent<Score> (); | ||
//scoreScript.PlayerScore++; | ||
//Debug.Log (scoreScript.PlayerScore); | ||
|
||
|
||
|
||
Destroy (gameObject); | ||
//score.PlayerScore++; | ||
} | ||
|
||
|
||
|
||
|
||
using UnityEngine.UI; | ||
|
||
public class Brick : MonoBehaviour | ||
{ | ||
|
||
public GameObject GameMaster; | ||
|
||
public Score scoreScript; | ||
|
||
Text score; | ||
|
||
public static int scoreValue; | ||
|
||
public AudioClip beep; | ||
public AudioSource source; | ||
|
||
void Awake() | ||
{ | ||
score = GetComponent<Text>(); | ||
scoreValue = 0; | ||
source = GetComponent<AudioSource>(); | ||
} | ||
void OnCollisionEnter(Collision other) | ||
{ | ||
Destroy(gameObject); | ||
scoreValue = scoreValue + 1; | ||
} | ||
void Update() | ||
{ | ||
score.text = "Score: " + scoreValue; | ||
if (scoreValue == 8) | ||
{ | ||
Application.LoadLevel(2); | ||
} | ||
switch(scoreValue) | ||
{ | ||
case 1: | ||
source.PlayOneShot(beep, 1f); | ||
break; | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using UnityEngine.UI; | ||
|
||
public class Brick2 : MonoBehaviour { | ||
public GameObject GameMaster; | ||
|
||
public Score scoreScript; | ||
|
||
Text score; | ||
|
||
public static int scoreValue; | ||
|
||
void Awake() | ||
{ | ||
score = GetComponent<Text>(); | ||
scoreValue = 0; | ||
} | ||
void OnCollisionEnter(Collision other) | ||
{ | ||
Destroy(gameObject); | ||
scoreValue = scoreValue + 1; | ||
} | ||
void Update() | ||
{ | ||
score.text = "Score: " + scoreValue; | ||
if (scoreValue == 20) | ||
{ | ||
Application.LoadLevel(3); | ||
} | ||
} | ||
|
||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class MainMenu : MonoBehaviour | ||
{ | ||
|
||
// Use this for initialization | ||
void Start() | ||
{ | ||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
} | ||
public void onClick() | ||
{ | ||
Application.LoadLevel(0); | ||
|
||
} | ||
public void startGame() | ||
{ | ||
Application.LoadLevel(1); | ||
} | ||
|
||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class Sounds : MonoBehaviour { | ||
|
||
public AudioClip beep; | ||
public AudioClip crash; | ||
public AudioSource source; | ||
// Update is called once per frame | ||
void Update () { | ||
source = GetComponent<AudioSource>(); | ||
} | ||
} |
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.
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
0000.55d3536a.0000 | ||
0000.55d3538a.0000 | ||
0000.55e0ab26.0000 | ||
0000.55e0ab44.0000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
m_EditorVersion: 5.1.3f1 | ||
m_EditorVersion: 5.2.0f3 | ||
m_StandardAssetsVersion: 0 |