From d37e365d0ecfa18fe39d5491035c6e080ac422bd Mon Sep 17 00:00:00 2001 From: Santi Date: Tue, 25 Jun 2024 00:34:49 +0100 Subject: [PATCH] Unity: Added Folders Catch: Started Code on Catch Game - Objects spawn and player can catch. Comments on progress and next steps --- Assets/Scripts/BoxTeleport.cs | 50 ------------ Assets/Scripts/BoxTeleport.cs.meta | 11 --- Assets/Scripts/Colours.cs | 33 -------- Assets/Scripts/Colours.cs.meta | 11 --- Assets/Scripts/Hamor.cs | 80 ------------------- Assets/Scripts/Hamor.cs.meta | 11 --- Assets/Scripts/Moles.cs | 110 -------------------------- Assets/Scripts/Moles.cs.meta | 11 --- Assets/Scripts/Moles_IsHit.cs | 28 ------- Assets/Scripts/Moles_IsHit.cs.meta | 11 --- Assets/Scripts/PickUpObject.cs | 101 ----------------------- Assets/Scripts/PickUpObject.cs.meta | 11 --- Documentation/Game-Design-Document.md | 30 ++++--- 13 files changed, 20 insertions(+), 478 deletions(-) delete mode 100644 Assets/Scripts/BoxTeleport.cs delete mode 100644 Assets/Scripts/BoxTeleport.cs.meta delete mode 100644 Assets/Scripts/Colours.cs delete mode 100644 Assets/Scripts/Colours.cs.meta delete mode 100644 Assets/Scripts/Hamor.cs delete mode 100644 Assets/Scripts/Hamor.cs.meta delete mode 100644 Assets/Scripts/Moles.cs delete mode 100644 Assets/Scripts/Moles.cs.meta delete mode 100644 Assets/Scripts/Moles_IsHit.cs delete mode 100644 Assets/Scripts/Moles_IsHit.cs.meta delete mode 100644 Assets/Scripts/PickUpObject.cs delete mode 100644 Assets/Scripts/PickUpObject.cs.meta diff --git a/Assets/Scripts/BoxTeleport.cs b/Assets/Scripts/BoxTeleport.cs deleted file mode 100644 index 4f1a24f..0000000 --- a/Assets/Scripts/BoxTeleport.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using TMPro; - -//* General Comments or Finished Tasks -//TODO Tasks left to be done for game -//! Bugs or Issues -//? Questions or Suggestions - -public class BoxTeleport : MonoBehaviour -{ - private GameObject currentContainer; - public int waitTime = 3; - public TextMeshProUGUI scoreText; - private int score; - - void Start() - { - scoreText.text = "Score: 0"; - } - private void OnTriggerEnter(Collider other) - { - - if(other.gameObject.tag == "Container") - { - currentContainer = other.gameObject; - //* If the box is not the same colour as the container, teleport the box after a few seconds - if(currentContainer.gameObject.GetComponentInParent().material.name == gameObject.GetComponent().material.name) - { - gameObject.transform.position = new Vector3(Random.Range(10, -10), 15, Random.Range(-10, 10)); - score =+ 1; - scoreText.text = "Score: " + score; - } - else - { - - StartCoroutine(BoxSpawn()); - } - - } - } - - //* Teleport the box to a random location in the air - IEnumerator BoxSpawn() - { - yield return new WaitForSeconds(waitTime); - gameObject.transform.position = new Vector3(Random.Range(10, -10), 15, Random.Range(-10, 10)); - } -} diff --git a/Assets/Scripts/BoxTeleport.cs.meta b/Assets/Scripts/BoxTeleport.cs.meta deleted file mode 100644 index a6e2947..0000000 --- a/Assets/Scripts/BoxTeleport.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: b82d7abf31c7ee246af2125333411a70 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Colours.cs b/Assets/Scripts/Colours.cs deleted file mode 100644 index bb3b51b..0000000 --- a/Assets/Scripts/Colours.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using Unity.VisualScripting; -using UnityEngine; - -//* General Comments or Finished Tasks -//TODO Tasks left to be done for game -//! Bugs or Issues -//? Questions or Suggestions - -public class Colours : MonoBehaviour -{ - public GameObject Box; - public GameObject[] containers; - public List materials = new List(); - private GameObject currentBox; - private int num; - //* Start is called before the first frame update - void Start() - { - //* Instantiate 8 containers with random colours at the start of the game - for (int i = 0; i < containers.Length; i++) - { - currentBox = Instantiate(Box, new Vector3(Random.Range(10, -10), 15, Random.Range(-10, 10)), Quaternion.identity); - num = Random.Range(0, materials.Count); - currentBox.GetComponent().material = materials[num]; - containers[i].GetComponent().material = materials[num]; - materials.RemoveAt(num); - } - } -} diff --git a/Assets/Scripts/Colours.cs.meta b/Assets/Scripts/Colours.cs.meta deleted file mode 100644 index ce145cd..0000000 --- a/Assets/Scripts/Colours.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f07fa7e7d67ec954ca9474c2da335e60 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Hamor.cs b/Assets/Scripts/Hamor.cs deleted file mode 100644 index 162bf90..0000000 --- a/Assets/Scripts/Hamor.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Dynamic; -using TMPro; -using UnityEngine; - -//* General Comments or Finished Tasks -//TODO Tasks left to be done for game -//! Bugs or Issues -//? Questions or Suggestions - -//* Prevent player from moving when they are hitting the moles -public class Hamor : MonoBehaviour -{ - public Animator hamorAnimator; - public GameObject bonkParticles; - public GameObject contact; - public bool particles = false; - public TextMeshProUGUI scoreText; - public int score = 0; - public Moles_IsHit moles; - public Movement movement; - //* Start is called before the first frame update - void Start() - { - - } - - //* Update is called once per frame - void Update() - { - if(Input.GetMouseButtonDown(0)) - { - movement.hammer = true; - hamorAnimator.SetTrigger("Bonk"); //* Play the bonk animation - StartCoroutine(MoveTimer()); - } - } - - IEnumerator MoveTimer() - { - yield return new WaitForSeconds(1); - movement.hammer = false; - } - IEnumerator BonkTimer() - { - yield return new WaitForSeconds(1); - particles = false; - } - - private void OnTriggerEnter(Collider other) { - if(particles == false) - { - if(other.tag != "Player") - { - //* Play the bonk particles - var parLocation = Instantiate(bonkParticles, contact.transform.position, Quaternion.identity); - Destroy(parLocation, 1); - particles = true; - StartCoroutine(BonkTimer()); - } - } - - if(other.gameObject.tag == "Mole") - { - //* Get the Moles_IsHit script from the mole - moles = other.gameObject.GetComponent(); - - //* If the mole has not been hit, increase the score and change bool - if(moles.IsHit == false) - { - score += 1; - scoreText.text = "Score: " + score.ToString(); - moles.IsHit = true; - } - } - - - } -} diff --git a/Assets/Scripts/Hamor.cs.meta b/Assets/Scripts/Hamor.cs.meta deleted file mode 100644 index 7b9e05b..0000000 --- a/Assets/Scripts/Hamor.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 388458319b483a949a166a07083c9590 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Moles.cs b/Assets/Scripts/Moles.cs deleted file mode 100644 index 6c1c411..0000000 --- a/Assets/Scripts/Moles.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using JetBrains.Annotations; -using Unity.VisualScripting; -using UnityEngine; - -//* General Comments or Finished Tasks -//TODO Tasks left to be done for game -//! Bugs or Issues -//? Questions or Suggestions - -//TODO Moles need to change textures when hit to show they have been hit - need textures for this -//* As the time goes on, moles appear and disappear faster -//* Moles that are hit slowly move down into their hole -//TODO Ajust the speed of the moles appearing and disappearing based on the time remaining - -public class Moles : MonoBehaviour -{ - public GameObject hole1, hole2, hole3, hole4, hole5, hole6, hole7, hole8, hole9; - public GameObject mole; - private float defaultSpeed = 10f; - public float timerSpeed; - public float lifeTime = 4f; - public float timerlifeTime; - public bool moleCanAppear = false; - public int randomHole, randomHole2, randomHole3; - public Timer timer; - //* Start is called before the first frame update - void Start() - { - moleCanAppear = true; - } - - //* Update is called once per frame - void Update() - { - timerSpeed = defaultSpeed * (timer.timeRemaining/120); - timerlifeTime = lifeTime * (timer.timeRemaining/120); - if(moleCanAppear) - { - randomHole = Random.Range(1, 9); - randomHole2 = Random.Range(1, 9); - while(randomHole2 == randomHole) - { - randomHole2 = Random.Range(1, 9); - } - randomHole3 = Random.Range(1, 9); - while(randomHole3 == randomHole || randomHole3 == randomHole2) - { - randomHole3 = Random.Range(1, 9); - } - moleCanAppear = false; - holeSelection(randomHole); - holeSelection(randomHole2); - holeSelection(randomHole3); - StartCoroutine(MoleTimer()); - } - } - - void holeSelection(int randomHole) - { - //* Prevent the same hole from being selected twice - switch (randomHole) - { - case 1: - var boxLocation = Instantiate(mole, hole1.transform.position, Quaternion.identity); - - Destroy(boxLocation, timerlifeTime); - break; - case 2: - var boxLocation2 = Instantiate(mole, hole2.transform.position, Quaternion.identity); - Destroy(boxLocation2, timerlifeTime); - break; - case 3: - var boxLocation3 = Instantiate(mole, hole3.transform.position, Quaternion.identity); - Destroy(boxLocation3, timerlifeTime); - break; - case 4: - var boxLocation4 = Instantiate(mole, hole4.transform.position, Quaternion.identity); - Destroy(boxLocation4, timerlifeTime); - break; - case 5: - var boxLocation5 = Instantiate(mole, hole5.transform.position, Quaternion.identity); - Destroy(boxLocation5, timerlifeTime); - break; - case 6: - var boxLocation6 = Instantiate(mole, hole6.transform.position, Quaternion.identity); - Destroy(boxLocation6, timerlifeTime); - break;; - case 7: - var boxLocation7 = Instantiate(mole, hole7.transform.position, Quaternion.identity); - Destroy(boxLocation7, timerlifeTime); - break; - case 8: - var boxLocation8 = Instantiate(mole, hole8.transform.position, Quaternion.identity); - Destroy(boxLocation8, timerlifeTime); - break; - case 9: - var boxLocation9 = Instantiate(mole, hole9.transform.position, Quaternion.identity); - Destroy(boxLocation9, timerlifeTime); - break; - } - } - - IEnumerator MoleTimer() - { - yield return new WaitForSeconds(timerSpeed); - moleCanAppear = true; - } -} diff --git a/Assets/Scripts/Moles.cs.meta b/Assets/Scripts/Moles.cs.meta deleted file mode 100644 index 995aefe..0000000 --- a/Assets/Scripts/Moles.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2a05eee06c231ea4f849ab3415485fe1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Moles_IsHit.cs b/Assets/Scripts/Moles_IsHit.cs deleted file mode 100644 index ef71e49..0000000 --- a/Assets/Scripts/Moles_IsHit.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -//* General Comments or Finished Tasks -//TODO Tasks left to be done for game -//! Bugs or Issues -//? Questions or Suggestions - -public class Moles_IsHit : MonoBehaviour -{ - public bool IsHit; - //* Start is called before the first frame update - void Start() - { - IsHit = false; //* Mole starts as not being hit - } - - //* Update is called once per frame - void Update() - { - if(IsHit) - { - //* Slowly move the mole down into the hole - transform.position = new Vector3(transform.position.x, transform.position.y - 0.01f, transform.position.z); - } - } -} diff --git a/Assets/Scripts/Moles_IsHit.cs.meta b/Assets/Scripts/Moles_IsHit.cs.meta deleted file mode 100644 index 0258efc..0000000 --- a/Assets/Scripts/Moles_IsHit.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: cd50fe78e80ef7046a1452af2b97de93 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/PickUpObject.cs b/Assets/Scripts/PickUpObject.cs deleted file mode 100644 index c2cc518..0000000 --- a/Assets/Scripts/PickUpObject.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Unity.VisualScripting; -using UnityEngine; -using UnityEngine.Animations; -using UnityEngine.UIElements; - -//* General Comments or Finished Tasks -//TODO Tasks left to be done for game -//! Bugs or Issues -//? Questions or Suggestions - -//! Somtimes boxes get thrown further than other times. Boxes also sometimes get thrown into random directions. -public class PickUpObject : MonoBehaviour -{ - public GameObject carryPosition; // blank object, position declares where the object will be teleported to/carried - public bool insideTrigger = false; // checks if player is inside the trigger of a pickup object - public bool playerIsCarrying = false; // checks if player is carrying an object - public GameObject nearestCarriableObject; - public GameObject previousObject; // previous object that player was carrying - public GameObject heldObject; // object that player is currently holding - public float throwForce; - /// - /// Cooldown time between picking up objects in seconds - /// - public float cooldownSeconds = 1; - public bool cooldownActive = true; - public KeyCode interactKey = KeyCode.F; - - // Update is called once per frame - void Update() - { - // * Cubes are quite hot so need time to cool off - cooldownSeconds -= Time.deltaTime; - cooldownActive = cooldownSeconds > 0; - - // * Old objects deserve gravity too - if(previousObject != null && previousObject.GetComponent().useGravity == false) - { - previousObject.GetComponent().useGravity = true; - } - - if(insideTrigger && Input.GetKeyDown(KeyCode.F) && !cooldownActive) - { - // * Who needs gravity - nearestCarriableObject.GetComponent().useGravity = false; - playerIsCarrying = true; - heldObject = nearestCarriableObject; - cooldownSeconds = 1; - } - // * YEET - else if(playerIsCarrying && Input.GetKeyDown(KeyCode.F)) - { - heldObject.GetComponent().useGravity = true; - previousObject = heldObject; - playerIsCarrying = false; - previousObject.GetComponent().AddForce(transform.forward * throwForce, ForceMode.Impulse); - Debug.Log("Yoted!"); - } - - // * Cubes not stored above heads are highly dangerous - if(playerIsCarrying) - { - nearestCarriableObject.transform.position = carryPosition.transform.position; - nearestCarriableObject.transform.rotation = carryPosition.transform.rotation; - } - } - - //* Called when the player is inside a trigger tagged as PickupObject - void OnTriggerStay(Collider otherObject) - { - if(otherObject.gameObject.tag == "PickupObject" && !cooldownActive) - { - nearestCarriableObject = otherObject.gameObject; - insideTrigger = true; - // * old cube is boring - if(heldObject != null && heldObject != nearestCarriableObject && playerIsCarrying) - { - previousObject = heldObject; - cooldownSeconds = 1; - } - } - } - - //* If player is not inside trigger, then they probably aren't inside it - void OnTriggerExit(Collider otherObject) - { - if(otherObject.gameObject.tag == "PickupObject") - { - insideTrigger = false; - } - } -} - -//! To make player launch self: -//! add public GameObject player; and place player in it fron inspector -//! in if(insiderTrigger && Input.GetKeyDown(KeyCode.F)) -//! Place the code below: -//! player.GetComponent().AddForce(transform.forward * throwForce, ForceMode.Impulse); -//! Run the game and press F to launch the player \ No newline at end of file diff --git a/Assets/Scripts/PickUpObject.cs.meta b/Assets/Scripts/PickUpObject.cs.meta deleted file mode 100644 index 9bed783..0000000 --- a/Assets/Scripts/PickUpObject.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: eca94ba4e2f880644ab196f816624ee6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Documentation/Game-Design-Document.md b/Documentation/Game-Design-Document.md index 56a8b53..19dd209 100644 --- a/Documentation/Game-Design-Document.md +++ b/Documentation/Game-Design-Document.md @@ -22,7 +22,7 @@ By Arlo Filley, Santiago Balbuena Goni, and Michael Morbin - [Concept](#concept) - [Mini-Game Concepts](#mini-game-concepts) - [Types](#types) - - [Mini-Games](#mini-games) + - [Games](#games) - [Art \& Audio](#art--audio) - [By Mikael Morbid](#by-mikael-morbid) - [Design](#design) @@ -34,7 +34,7 @@ By Arlo Filley, Santiago Balbuena Goni, and Michael Morbin - [References](#references) - [Websites](#websites) - [Software](#software) - - [Games](#games) + - [Games](#games-1) # Introduction @@ -165,15 +165,25 @@ Minigames will range in type and genre giving the player a diverse playing exper ### Types -- Memory Games -- Reaction Games -- Puzzle Games -- Rhythm + * Memory Games + * Reaction Games + * Puzzle Games + * Rhythm + +### Games + + * Dodging (Undertale style?) + * Whackamole + * Catch + * Beating With Sticks + * Sorting + * Centre Balance + * Conveyors + * Defend! + * Jump Rope + * Parkour + * QuickShot -### Mini-Games -- Dodging (Undertale style?) -- Whackamole -- Catch # Art & Audio ### By Mikael Morbid