-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This is the first version of Wall Destroyer that GitHub has ever seen!
- 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.
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.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma strict | ||
var maxFallDistance = -5; | ||
var Left = 12; | ||
|
||
function Start () { | ||
var times = 20; | ||
while (times > -1 && PlayerPrefs.GetInt("GameOver") == 1) { | ||
yield WaitForSeconds (1); | ||
times--; | ||
if (times == 0) { | ||
Destroy (gameObject); | ||
} | ||
} | ||
} | ||
|
||
function Update () { | ||
if (Input.GetMouseButtonDown(0)) { | ||
var hit: RaycastHit; | ||
var ray = Camera.main.ScreenPointToRay(Input.mousePosition); | ||
if(Physics.Raycast(ray, hit)){ | ||
if (hit.transform.name == this.name && PlayerPrefs.GetInt("GameOver") != 1) { | ||
PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score") + 1); | ||
PlayerPrefs.SetInt("Block Total", PlayerPrefs.GetInt("Block Total") - 1); | ||
PlayerPrefs.SetInt(this.name, 0); | ||
Destroy (gameObject); //Nothing after | ||
} | ||
|
||
} | ||
} | ||
|
||
if (transform.position.y <= maxFallDistance && Application.loadedLevelName == "MainMenu") { | ||
Destroy (gameObject); | ||
} | ||
} | ||
|
||
function OnCollisionEnter(col : Collision) { | ||
if (col.collider.name == "Limit" && PlayerPrefs.GetInt("GameOver") != 1) { | ||
PlayerPrefs.SetInt("GameOver", 1); | ||
Debug.Log("END"); | ||
} | ||
} |
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,62 @@ | ||
#pragma strict | ||
import System.Collections.Generic; | ||
|
||
var original : GameObject; | ||
//var MiniMenu : GameObject; | ||
var MaxBlocks : int; | ||
var BB88 : int; | ||
var Blockorz : GameObject; | ||
var EndMenu : GameObject; | ||
var imports = new List.<int>(); | ||
var Score : UnityEngine.UI.Text; | ||
var HighScore : UnityEngine.UI.Text; | ||
var Level : int; | ||
|
||
function Start () { | ||
PlayerPrefs.SetInt("Score", 0); | ||
PlayerPrefs.SetInt("Block Total", 0); | ||
PlayerPrefs.SetInt("GameOver", 0); | ||
MaxBlocks = 4; | ||
while (1 > 0) { | ||
Level = Random.Range(1,8); | ||
while (Level > 0) { //CREATING THE BLOCKS | ||
var Rando = Random.Range(-3,4); | ||
while(imports.Contains(Rando)) { | ||
Rando = Random.Range(-3,4); | ||
} | ||
Blockorz = Instantiate(original, new Vector3 (Rando, 12, 0), Quaternion.identity); | ||
PlayerPrefs.SetInt("Block Total", PlayerPrefs.GetInt("Block Total") + 1); | ||
BB88++; | ||
Blockorz.name = "Block #" + BB88; | ||
imports.Add (Rando); | ||
Level--; | ||
} | ||
imports.Clear(); | ||
yield WaitForSeconds (1); | ||
} | ||
} | ||
|
||
function Update () { | ||
Score.text = "Score: " + PlayerPrefs.GetInt("Score"); | ||
HighScore.text = "HighScore: " + PlayerPrefs.GetInt("Best"); | ||
|
||
if (PlayerPrefs.GetInt("Best") <= PlayerPrefs.GetInt("Score")) { | ||
PlayerPrefs.SetInt("Best", PlayerPrefs.GetInt("Score")); | ||
} | ||
|
||
if (PlayerPrefs.GetInt("GameOver") == 1) { //ENDING IT ALL | ||
EndMenu.SetActive(true); | ||
} | ||
} | ||
|
||
function Restart () { | ||
Application.LoadLevel ("Game"); | ||
} | ||
|
||
function Escape () { | ||
Application.LoadLevel ("MainMenu"); | ||
} | ||
|
||
function Suicide () { | ||
Application.Quit(); | ||
} |
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.