Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
52 changes: 52 additions & 0 deletions Assets/GameManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class GameManager : MonoBehaviour
{

private bool gameHasEnded = false;

public GameObject GameOverPanel;
public GameObject GameWonPanel;

IEnumerator waitEndScreen(float time)
{
yield return new WaitForSeconds(time);

GameOverPanel.SetActive(true);
}

public void EndGame()
{
if(!gameHasEnded)
{
gameHasEnded = true;
Debug.Log("Game Over!");
StartCoroutine(waitEndScreen(4f));

}
}
public void CompleteGame()
{
if(!gameHasEnded)
{
gameHasEnded = true;
Debug.Log("Game won!");
StartCoroutine(waitEndScreen(4f));
}
}

public void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}

public void Quit()
{
Application.Quit();
}
}

11 changes: 11 additions & 0 deletions Assets/GameManager.cs.meta

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

15 changes: 15 additions & 0 deletions Assets/Quit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Quit : MonoBehaviour
{
// Start is called before the first frame update
public GameManager gameManager;

public void QuitGame()
{
Debug.Log("Quit Button Clicked");
gameManager.Quit();
}
}
11 changes: 11 additions & 0 deletions Assets/Quit.cs.meta

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

8 changes: 8 additions & 0 deletions Assets/Scenes/BG.meta

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

Binary file added Assets/Scenes/BG/IMG_3784.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions Assets/Scenes/BG/IMG_3784.gif.meta

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

37 changes: 37 additions & 0 deletions Assets/Scenes/BG/Parallax.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Parallax : MonoBehaviour
{

private float length, startpos;
public GameObject cam;
public float parallaxEffect;

// Start is called before the first frame update
void Start()
{
startpos = transform.position.x;
length = this.transform.GetChild(0).GetComponent<SpriteRenderer>().bounds.size.x;

}

// Update is called once per frame
void FixedUpdate()
{
float temp = (cam.transform.position.x * (1 - parallaxEffect));
float dist = (cam.transform.position.x * parallaxEffect);

transform.position = new Vector3(startpos + dist, transform.position.y, transform.position.z);

if (temp > startpos + length)
{
startpos += length;
}
else if (temp < startpos - length)
{
startpos -= length;
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scenes/BG/Parallax.cs.meta

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

Binary file added Assets/Scenes/BG/cavern_layer_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions Assets/Scenes/BG/cavern_layer_1.png.meta

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

Binary file added Assets/Scenes/BG/cavern_layer_2 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading