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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Assets/Scripts/Clock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using UnityEngine;

public class Clock : MonoBehaviour
{
public AudioSource collectSound;
public Transform player;
public SlowDownTime timeSlower;

void OnTriggerEnter(Collider other)
{
if (other.transform == player)
{
collectSound.Play();
timeSlower.DoSlowmotion();
Destroy(gameObject);
}

}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Clock.cs.meta

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

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

public class Oxygen : MonoBehaviour
{
public AudioSource collectSound;
static float oxyLevel;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{

}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Oxygen.cs.meta

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

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

public class RefillOxygen : MonoBehaviour
{
public AudioSource collectSound;
public float capacity;

void OnTriggerEnter(Collider other)
{
if (other.transform == player)
{
collectSound.Play();
Oxygen.oxyLevel = capacity;
Destroy(gameObject);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/RefillOxygen.cs.meta

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

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

public class Score : MonoBehaviour
{
static float scoreRate = 1;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
if (ScoreMultiplier.hasHit && !Timer.running)
{
scoreRate = 1;
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Score.cs.meta

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

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

public class ScoreMultiplier : MonoBehaviour
{
public AudioSource collectSound;
public Transform player;

bool hasHit = false;

void OnTriggerEnter(Collider other)
{
if (other.transform == player)
{
collectSound.Play();
Score.scoreRate=2;
hasHit = true;
Destroy(gameObject);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/ScoreMultiplier.cs.meta

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

19 changes: 19 additions & 0 deletions Assets/Scripts/SlowDownTime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

using UnityEngine;

public class SlowDownTime : MonoBehaviour
{
public float slowdownFactor = 0.05f;
public float slowdownLength = 2f;

void Update()
{
Time.timeScale += (1f / slowdownLength) * Time.unscaledDeltaTime ;
Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f);
}
public void DoSlowmotion()
{
Time.timeScale = slowdownFactor;
Time.fixedDeltaTime = Time.timeScale * 0.02f;
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/SlowDownTime.cs.meta

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

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

public class Teleport : MonoBehaviour
{
public AudioSource collectSound;

Animator m_Animator;
float Width; //width of game window

void Start()
{
m_Animator = GetComponent<Animator>;
}

void OnTriggerEnter(Collider other)
{
m_Animator.enabled = true;
other.transform.position = new Vector3(Random.Range(-Width, Width), 0, other.transform.position.z + 100);

}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Teleport.cs.meta

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

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

public class Timer : MonoBehaviour
{
static float timedur = 0f;
static bool running = false;

void Update()
{
if (running)
{
timedur += Time.deltaTime;
}
if (timedur > 100)
{
running = false;
timedur = 0;
}

}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/Timer.cs.meta

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