diff --git a/Assets/Scripts/BackgroundInstance.cs b/Assets/Scripts/BackgroundInstance.cs deleted file mode 100644 index 875f7063fe57e94b7cf8b5441791a8e3a9cf5dfb..0000000000000000000000000000000000000000 --- a/Assets/Scripts/BackgroundInstance.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -[RequireComponent(typeof(BoxCollider2D))] - -public class BackgroundInstance : MonoBehaviour -{ - // Start is called before the first frame update - public BackgroundRoller roller; - bool flaggedForDelete = false; - - private void OnTriggerExit2D(Collider2D collision) - { - - if (collision.gameObject.CompareTag("MainCamera")) - { - Debug.Log("whoosh"); - - if(!flaggedForDelete) - { - flaggedForDelete = true; - StartCoroutine(DestroyCountdown()); - } - - - } - } - private void OnTriggerEnter2D(Collider2D collision) - { - if(collision.gameObject.CompareTag("MainCamera")) - { - Debug.Log("meow"); - roller.SetCurrentBgInstance(this.gameObject); - flaggedForDelete = false; - } - } - - private IEnumerator DestroyCountdown() - { - yield return new WaitForSeconds(10); - if(flaggedForDelete && gameObject!=null) - { - Debug.Log("Oh no we're doomed"); - Destroy(gameObject); - - } - } -} diff --git a/Assets/Scripts/BackgroundInstance.cs.meta b/Assets/Scripts/BackgroundInstance.cs.meta deleted file mode 100644 index 3136b39253635ff367de672da8184d8c56b6e1c2..0000000000000000000000000000000000000000 --- a/Assets/Scripts/BackgroundInstance.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 677803316bfc6c0408bf86ba89f7cdf1 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/BackgroundRoller.cs b/Assets/Scripts/BackgroundRoller.cs deleted file mode 100644 index dfbb816a7407f45484ddbf2d474cd7ea5ea41f6d..0000000000000000000000000000000000000000 --- a/Assets/Scripts/BackgroundRoller.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class BackgroundRoller : MonoBehaviour -{ - //rolls with constant speed now, could be adjusted to the movement speed of the platforms or the offset of the player - - - - private Camera camera; - public List<Sprite> bgSprites; - private int currentSprite = 0; - public GameObject currentBackgroundInstance; - public GameObject upcomingBackgroundInstance; - private BoxCollider2D bgCollider; - - public GameObject backgroundInstancePrefab; - - - void Start() - { - camera = Camera.main; - bgCollider = currentBackgroundInstance.GetComponent<BoxCollider2D>(); - settUpBackgroundInstance(currentBackgroundInstance); - } - - // Update is called once per frame - void Update() - { - Debug.Log("current spire" + currentSprite); - - if (currentSprite >= bgSprites.Count - 1) - { - currentSprite = -1; //never do this at home kids - } - - //if there are sprites left & we are over half the height, we instantiate another sprite at the top - if (currentSprite < bgSprites.Count - 1 && - camera.transform.position.y > currentBackgroundInstance.transform.position.y + bgCollider.size.y / 2 - camera.orthographicSize && - upcomingBackgroundInstance == null) - { - upcomingBackgroundInstance = Instantiate(backgroundInstancePrefab); - settUpBackgroundInstance(upcomingBackgroundInstance); - upcomingBackgroundInstance.transform.position = new Vector3(0, currentBackgroundInstance.transform.position.y + bgCollider.size.y * currentBackgroundInstance.transform.localScale.y, 0.1f); - - } - - - } - - public void SetCurrentBgInstance(GameObject bg) - { - currentBackgroundInstance = bg.gameObject; - upcomingBackgroundInstance = null; - bgCollider = bg.GetComponent<BoxCollider2D>(); - - } - - public void settUpBackgroundInstance(GameObject upcomingBackgroundInstance) - { - //https://answers.unity.com/questions/890148/scale-and-place-gameobject-as-a-background-of-the.html - //source - upcomingBackgroundInstance.transform.localScale = new Vector2((Camera.main.orthographicSize * 2 * Screen.width * 0.28f) / Screen.height, Camera.main.orthographicSize * 2 * 0.28f); - upcomingBackgroundInstance.transform.SetParent(transform); - upcomingBackgroundInstance.GetComponent<SpriteRenderer>().sprite = bgSprites[currentSprite]; - upcomingBackgroundInstance.GetComponent<BackgroundInstance>().roller = this; - currentSprite++; - } -} diff --git a/Assets/Scripts/BackgroundRoller.cs.meta b/Assets/Scripts/BackgroundRoller.cs.meta deleted file mode 100644 index 1f4421da22b844c9d3980efb763960ee5fb59433..0000000000000000000000000000000000000000 --- a/Assets/Scripts/BackgroundRoller.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 721bec2f5f1e48d4784acc70c548e367 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Bosses/EnemySpawnController.cs.meta b/Assets/Scripts/Bosses/EnemySpawnController.cs.meta index 391dbc276e973ec6b1911851ce3d19416ccd0e5a..64e5ae5a4f213bfc23df1483ab392dff915a952c 100644 --- a/Assets/Scripts/Bosses/EnemySpawnController.cs.meta +++ b/Assets/Scripts/Bosses/EnemySpawnController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 76e401c1083713d4891fdd07806c39d8 +guid: b3bf1c4775b94fc4bafc2c39dd8ec24a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Camera/BackgroundInstance.cs.meta b/Assets/Scripts/Camera/BackgroundInstance.cs.meta index 3136b39253635ff367de672da8184d8c56b6e1c2..0f8fc12ca58496274c9cf200cf9b8a7959809802 100644 --- a/Assets/Scripts/Camera/BackgroundInstance.cs.meta +++ b/Assets/Scripts/Camera/BackgroundInstance.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 677803316bfc6c0408bf86ba89f7cdf1 +guid: 69326e03a47a3bb44ab517fc461d7e29 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Camera/BackgroundRoller.cs.meta b/Assets/Scripts/Camera/BackgroundRoller.cs.meta index 1f4421da22b844c9d3980efb763960ee5fb59433..c0d43cd7bb5996f2ce6b2ac81f21f79c5d38b9ee 100644 --- a/Assets/Scripts/Camera/BackgroundRoller.cs.meta +++ b/Assets/Scripts/Camera/BackgroundRoller.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 721bec2f5f1e48d4784acc70c548e367 +guid: c9eb47910f88b4c48b48c3a56737feea MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Camera/CameraController.cs.meta b/Assets/Scripts/Camera/CameraController.cs.meta index df555f8fe31962c2fee43cd1ef6168466064ffe2..4ded15abb96a9b3868ef6a69e5a76a0d752951a6 100644 --- a/Assets/Scripts/Camera/CameraController.cs.meta +++ b/Assets/Scripts/Camera/CameraController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5a4449b2421c89a42b923468217fbf76 +guid: f969c2822ca7b6348a191d20027a70f4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Camera/FellOffController.cs.meta b/Assets/Scripts/Camera/FellOffController.cs.meta index d1eba2a4069c9707252de526d3b3765eb83afd7c..7399342e56d163d6a3a526435be9128b128515a8 100644 --- a/Assets/Scripts/Camera/FellOffController.cs.meta +++ b/Assets/Scripts/Camera/FellOffController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2c337c71b0ca81d4cabc0efcf6a32922 +guid: 20ba6e5a58c196f46bd2730c6533e92f MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Player/Main_camera.cs b/Assets/Scripts/Camera/Main_camera.cs similarity index 100% rename from Assets/Scripts/Player/Main_camera.cs rename to Assets/Scripts/Camera/Main_camera.cs diff --git a/Assets/Scripts/Player/Main_camera.cs.meta b/Assets/Scripts/Camera/Main_camera.cs.meta similarity index 100% rename from Assets/Scripts/Player/Main_camera.cs.meta rename to Assets/Scripts/Camera/Main_camera.cs.meta diff --git a/Assets/Scripts/CameraController.cs b/Assets/Scripts/CameraController.cs deleted file mode 100644 index 1a417067c650b8292d26295dce703c5857f85e92..0000000000000000000000000000000000000000 --- a/Assets/Scripts/CameraController.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -[RequireComponent(typeof(BoxCollider2D))] -public class CameraController : MonoBehaviour -{ - //this script literally just sets the camera collider size to the size of the viewport - //put here any new camera functionality - public Transform playerTransform; - private Transform cameraTransform; - private int cameraSpeed; - public Vector3 velocity = Vector3.zero; - public float smoothTime = 0.2f; - void Start() - { - GetComponent<BoxCollider2D>().size = new Vector2(Camera.main.orthographicSize * Camera.main.aspect * 2, Camera.main.orthographicSize*2); //width, height - cameraTransform = Camera.main.transform; - } - - private void FixedUpdate() - { - if(playerTransform.position.y-cameraTransform.position.y>0.01)//if the player is higher than the middle of the camera - { - Vector3 targetPosition = new Vector3(cameraTransform.position.x, playerTransform.position.y, cameraTransform.position.z); - cameraTransform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref velocity, smoothTime); - } - } - -} diff --git a/Assets/Scripts/CameraController.cs.meta b/Assets/Scripts/CameraController.cs.meta deleted file mode 100644 index df555f8fe31962c2fee43cd1ef6168466064ffe2..0000000000000000000000000000000000000000 --- a/Assets/Scripts/CameraController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5a4449b2421c89a42b923468217fbf76 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/EnemySpawnController.cs b/Assets/Scripts/EnemySpawnController.cs deleted file mode 100644 index 53e435d2c593ea020f4ed0afa41044085b3cc098..0000000000000000000000000000000000000000 --- a/Assets/Scripts/EnemySpawnController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using UnityEngine; -using UnityEngine.Serialization; -using Random = System.Random; - -public class EnemySpawnController : MonoBehaviour{ - private Main_camera _cameraScript; - private Player _player; - private Vector3 _newPos; - - [FormerlySerializedAs("OwlPrefab")] [SerializeField] private GameObject owlPrefab; - [FormerlySerializedAs("EnemySpawningOffset")] [SerializeField] private double enemySpawningOffset; - [SerializeField] private float ySpawningOffset; - - private static readonly Random Random = new Random(); - private void Start(){ - _cameraScript = GameManager.Instance.MainCamera.GetComponent<Main_camera>(); - _player = GameManager.Instance.Player; - _cameraScript.CameraMoved += CameraMove; - _newPos = _player.transform.position; - enemySpawningOffset = _cameraScript.ColliderSize.y * enemySpawningOffset; - } - - private void CameraMove(){ - var position = _player.transform.position; - var tmpPos = new Vector3(position.x, position.y + _cameraScript.ColliderSize.y * 2, position.z); - if (tmpPos.y - _newPos.y > enemySpawningOffset){ - _newPos = tmpPos; - var tmpRoute1 = new Vector3(-GameManager.Instance.x_offset, (float) (_newPos.y + GetRandomNumber(-ySpawningOffset, ySpawningOffset)), _newPos.z); - var tmpRoute2 = new Vector3(GameManager.Instance.x_offset, (float) (_newPos.y + GetRandomNumber(-ySpawningOffset, ySpawningOffset)), _newPos.z); - var newEnemy = Instantiate(owlPrefab, _newPos, Quaternion.identity); - newEnemy.GetComponent<Owl>().AddWayponts(new []{tmpRoute1, tmpRoute2}); - } - } - - private static double GetRandomNumber(double minValue, double maxValue) - { - var next = Random.NextDouble(); - var output = minValue + (next * (maxValue - minValue)); - print(output); - return output; - } -} diff --git a/Assets/Scripts/EnemySpawnController.cs.meta b/Assets/Scripts/EnemySpawnController.cs.meta deleted file mode 100644 index 391dbc276e973ec6b1911851ce3d19416ccd0e5a..0000000000000000000000000000000000000000 --- a/Assets/Scripts/EnemySpawnController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 76e401c1083713d4891fdd07806c39d8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/FellOffController.cs b/Assets/Scripts/FellOffController.cs deleted file mode 100644 index 2820e50053add147695f33c8e4f35bcb5c9c7156..0000000000000000000000000000000000000000 --- a/Assets/Scripts/FellOffController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class FellOffController : MonoBehaviour { - private Transform mainCameraTransform; - private Collider2D mainCameraCollider2D; - private Collider2D myCollider; - private bool falled = false; - - // Start is called before the first frame update - void Start() { - mainCameraTransform = GameManager.Instance.MainCamera.transform; - mainCameraCollider2D = GameManager.Instance.MainCamera.GetComponent<Collider2D>(); - myCollider = GetComponent<Collider2D>(); - - GetComponent<BoxCollider2D>().size = new Vector2(Camera.main.orthographicSize * Camera.main.aspect * 4, 1); - Vector2 nPos = mainCameraTransform.position; - nPos.y -= (mainCameraCollider2D.bounds.size.y / 2 + myCollider.bounds.size.y / 2); - transform.position = nPos; - } - - private void OnTriggerEnter2D(Collider2D other) { - if (other.CompareTag("Player")) { - if (!falled) - GameManager.Instance.FellDown(); - } - } - - private void OnTriggerExit2D(Collider2D other) { - if (falled) - GameManager.Instance.Player.hurt(); - } - - public void Fallen() { - falled = true; - } -} \ No newline at end of file diff --git a/Assets/Scripts/FellOffController.cs.meta b/Assets/Scripts/FellOffController.cs.meta deleted file mode 100644 index d1eba2a4069c9707252de526d3b3765eb83afd7c..0000000000000000000000000000000000000000 --- a/Assets/Scripts/FellOffController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 2c337c71b0ca81d4cabc0efcf6a32922 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/ItemDestroyer.cs b/Assets/Scripts/ItemDestroyer.cs deleted file mode 100644 index b843267770ce6e7bbfd34559ac75bb841ec749ab..0000000000000000000000000000000000000000 --- a/Assets/Scripts/ItemDestroyer.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class ItemDestroyer : MonoBehaviour { - private List<Collider2D> colliders = new List<Collider2D>(); - private void OnTriggerExit2D(Collider2D col) { - // Ha platformmal talazunk - if (col.gameObject.CompareTag("Coin") && !colliders.Contains(col)) { - // Toroljuk azt aki lent volt - colliders.Add(col); - col.GetComponent<ItemBaseCollision>().DestroyItem(); - ItemSpawner.Instance.DecreaseCoinNum(); - } - - if (col.gameObject.CompareTag("SpecialItem") && !colliders.Contains(col)) { - // Toroljuk azt aki lent volt - colliders.Add(col); - col.GetComponent<ItemBaseCollision>().DestroyItem(); - ItemSpawner.Instance.DecreaseSpecialNum(); - } - } - - private void Update() { - colliders.Clear(); - } -} diff --git a/Assets/Scripts/ItemDestroyer.cs.meta b/Assets/Scripts/ItemDestroyer.cs.meta deleted file mode 100644 index c97e80665bfe4cfd5a2431855fb30203a41f30e2..0000000000000000000000000000000000000000 --- a/Assets/Scripts/ItemDestroyer.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 62fff5dd8f0ce9a4ea3cc2832ef5e8a3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/ItemSpawner.cs b/Assets/Scripts/ItemSpawner.cs deleted file mode 100644 index 25cdb040aca7d222a33cded7929d7dcf710036b0..0000000000000000000000000000000000000000 --- a/Assets/Scripts/ItemSpawner.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEditorInternal; -using UnityEngine; -using Random = UnityEngine.Random; - -public class ItemSpawner : MonoBehaviour { - public static ItemSpawner Instance { get; private set; } - private float width; - private float height; - - [Header("Special")] - [SerializeField] private float chanceToSpawnSpecial = 0.4f; - [SerializeField] private int maxSpecialNum = 3; - [SerializeField] private int minSpecialNum = 0; - [SerializeField] private BaseItemEffect[] specialItems; - private int specialNum; - - [Header("Coin")] - [SerializeField] private float chanceToSpawnCoin = 0.8f; - [SerializeField] private int maxCoinNum = 5; - [SerializeField] private int minCoinNum = 1; - [SerializeField] private Coin coinPrefab; - [SerializeField] private int minCoinValue = 50; - [SerializeField] private int maxCoinValue = 500; - private int coinNum; - - private float lastY; - private float m_PlayerY; - void Start() { - if (Instance != null) - Destroy(gameObject); - else - Instance = this; - - width = Camera.main.orthographicSize * Camera.main.aspect; - height = Camera.main.orthographicSize * 2; - m_PlayerY = GameManager.Instance.Player.transform.position.y; - - coinNum = 0; - specialNum = 0; - - lastY = m_PlayerY; - - SpawnItems(); - } - void Update() { - SpawnItems(); - } - private void SpawnItems() { - if (coinNum <= minCoinNum) { - for (int i = 0; i < (maxCoinNum - coinNum); ++i) { - if (Random.Range(0.0f, 1.0f) < chanceToSpawnCoin) { - SpawnCoin(); - } - } - - while (coinNum < minCoinNum) { - SpawnCoin(); - } - - lastY += height / 2; - } - - if (specialNum <= minSpecialNum) { - for (int i = 0; i < (maxSpecialNum - specialNum); ++i) { - if (Random.Range(0.0f, 1.0f) < chanceToSpawnSpecial) { - SpawnSpecial(); - } - } - - while (specialNum < minSpecialNum) { - SpawnSpecial(); - } - - lastY += height / 2; - } - } - private void SpawnCoin() { - var tmp = GenerateNextItemPos(); - Coin coin = Instantiate(coinPrefab, tmp, Quaternion.identity); - coin.coinBonusLowerBound = minCoinValue; - coin.coinBonusUpperBound = maxCoinValue; - coinNum++; - } - private void SpawnSpecial() { - var tmp = GenerateNextItemPos(); - Instantiate(specialItems[Random.Range(0, specialItems.Length)], tmp, Quaternion.identity); - specialNum++; - } - private Vector2 GenerateNextItemPos() { - - float x = Random.Range(-width / 2, width / 2); - float y = Mathf.Max(lastY, m_PlayerY) + Random.Range(0.2f, height / 2); - Vector2 tmp = new Vector2(x, y); - lastY = y; - return tmp; - } - public void DecreaseCoinNum() { - coinNum--; - } - public void DecreaseSpecialNum() { - specialNum--; - } -} \ No newline at end of file diff --git a/Assets/Scripts/ItemSpawner.cs.meta b/Assets/Scripts/ItemSpawner.cs.meta deleted file mode 100644 index 2246c9da6736ff0949156af492ace18f71dc3979..0000000000000000000000000000000000000000 --- a/Assets/Scripts/ItemSpawner.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 616440c7c868257439ec39a2ac72a4b9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Items/ItemDestroyer.cs.meta b/Assets/Scripts/Items/ItemDestroyer.cs.meta index c97e80665bfe4cfd5a2431855fb30203a41f30e2..7fb7cea6e002b133d32b7e2e81423e0ab98fbf28 100644 --- a/Assets/Scripts/Items/ItemDestroyer.cs.meta +++ b/Assets/Scripts/Items/ItemDestroyer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 62fff5dd8f0ce9a4ea3cc2832ef5e8a3 +guid: 5dbaa0ef5fbfe534ca6b31846696cf7a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Items/ItemSpawner.cs.meta b/Assets/Scripts/Items/ItemSpawner.cs.meta index 2246c9da6736ff0949156af492ace18f71dc3979..1c1dc3234e6ca6d0d894de9391db98bc8db4ff3e 100644 --- a/Assets/Scripts/Items/ItemSpawner.cs.meta +++ b/Assets/Scripts/Items/ItemSpawner.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 616440c7c868257439ec39a2ac72a4b9 +guid: a9fa613fe0f950b45bd971e6b09ea090 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Menu/MenuController.cs.meta b/Assets/Scripts/Menu/MenuController.cs.meta index 6972fd2a91581663f32d6dedf4874ca7636f5d35..4f7c07afe5a6847f28b9b54357c5146ff1bbf04e 100644 --- a/Assets/Scripts/Menu/MenuController.cs.meta +++ b/Assets/Scripts/Menu/MenuController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bc687a0428b1c9249907e57f5201647e +guid: 179eb137c404bf94d8d3b642861d8b32 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Menu/menuButtons.cs.meta b/Assets/Scripts/Menu/menuButtons.cs.meta index f83c0bd30a0a23a2533666cdbd4761e6eee4ae06..bf208b5b99bd1ae125f633d3a30f999e41d22cc8 100644 --- a/Assets/Scripts/Menu/menuButtons.cs.meta +++ b/Assets/Scripts/Menu/menuButtons.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 34767b4c9fb8a964581d2cbf1e9288e8 +guid: 50e0e77bd41942245b69f6035b6292e7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/MenuController.cs b/Assets/Scripts/MenuController.cs deleted file mode 100644 index ce48b5814b7a6ed77d135f680e4150eed315cb99..0000000000000000000000000000000000000000 --- a/Assets/Scripts/MenuController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class MenuController : MonoBehaviour { - [SerializeField] private Animator mainMenuAnimator; - [SerializeField] private Animator optionAnimator; - [SerializeField] private Animator leaderboardAnimator; - - public void OptionButton() { - mainMenuAnimator.Play("MainOut"); - optionAnimator.Play("OptionIn"); - } - - public void BackButton() { - mainMenuAnimator.Play("MenuIn"); - optionAnimator.Play("OptionOut"); - } - - public void leaderboardButton() - { - mainMenuAnimator.Play("MainOut"); - leaderboardAnimator.Play("LeaderboardIn"); - } - - public void backButtonLeaderboard() - { - mainMenuAnimator.Play("MenuIn"); - leaderboardAnimator.Play("LeaderboardOut"); - } -} \ No newline at end of file diff --git a/Assets/Scripts/MenuController.cs.meta b/Assets/Scripts/MenuController.cs.meta deleted file mode 100644 index 6972fd2a91581663f32d6dedf4874ca7636f5d35..0000000000000000000000000000000000000000 --- a/Assets/Scripts/MenuController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: bc687a0428b1c9249907e57f5201647e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/OnkoltsegController.cs b/Assets/Scripts/OnkoltsegController.cs deleted file mode 100644 index 3cf72bc920094270368747c36abba391eba04738..0000000000000000000000000000000000000000 --- a/Assets/Scripts/OnkoltsegController.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class OnkoltsegController : MonoBehaviour { - [SerializeField] private float waitingTime = 3; - [SerializeField] private float raisingSpeed = 2; - - public float RaisingSpeed { - get => raisingSpeed; - set { - if (value <= 0) { - throw new ArgumentException("Onkoltseg Speed Cannot be zero or less."); - } - - raisingSpeed = value; - } - } - - public float WaitingTime { - get => waitingTime; - set { - if (value <= 0) { - throw new ArgumentException("Onkoltseg Time Cannot be zero or less."); - } - - waitingTime = value; - } - } - - public bool Enable{ get; set; } - - private Rigidbody2D _rb; - private float tmpWaitingTime; - private Transform mainCameraTransform; - private Collider2D mainCameraCollider2D; - private Collider2D myCollider; - - private bool moving; - - private bool end = false; - // Start is called before the first frame update - void Start(){ - Enable = false; - tmpWaitingTime = waitingTime; - moving = false; - _rb = GetComponent<Rigidbody2D>(); - myCollider = GetComponent<Collider2D>(); - mainCameraTransform = GameManager.Instance.MainCamera.transform; - mainCameraCollider2D = GameManager.Instance.MainCamera.GetComponent<Collider2D>(); - } - - public void ResetTimer() { - tmpWaitingTime = waitingTime; - if (moving) - _rb.velocity = Vector2.zero; - - moving = false; - } - - private void StartMoving() { - if (!Enable) return; - Vector2 nPos = mainCameraTransform.position; - nPos.y -= (mainCameraCollider2D.bounds.size.y / 2 + myCollider.bounds.size.y / 2); - transform.position = nPos; - moving = true; - - _rb.velocity = Vector2.up * raisingSpeed; - } - - private void Update() { - if (!Enable) return; - if (tmpWaitingTime <= 0 && !moving && !end) - StartMoving(); - else if (!moving && !end) - tmpWaitingTime -= Time.deltaTime; - } - - private void OnTriggerEnter2D(Collider2D other) { - // Elkerjuk az utkozestol az enemyt - Player player = other.GetComponent<Player>(); - // Megnezzuk, hogy tenyleg egy ellenseggel utkoztunk e - if (player) { - player.hurt(); - } - } - - public void GameEnd() { - end = true; - Vector2 nPos = mainCameraTransform.position; - nPos.y += (mainCameraCollider2D.bounds.size.y / 2 + myCollider.bounds.size.y / 2); - transform.position = nPos; - } -} \ No newline at end of file diff --git a/Assets/Scripts/OnkoltsegController.cs.meta b/Assets/Scripts/OnkoltsegController.cs.meta deleted file mode 100644 index 48d9d780c9ec4e37e98d74bd1a83fc46e3a3ab64..0000000000000000000000000000000000000000 --- a/Assets/Scripts/OnkoltsegController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3bc2e633913ded64886a4669a8dc1934 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Platforms/OnkoltsegController.cs.meta b/Assets/Scripts/Platforms/OnkoltsegController.cs.meta index 48d9d780c9ec4e37e98d74bd1a83fc46e3a3ab64..49263c21dfe3a8a5c0bd55edf924c00bc38ea52f 100644 --- a/Assets/Scripts/Platforms/OnkoltsegController.cs.meta +++ b/Assets/Scripts/Platforms/OnkoltsegController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3bc2e633913ded64886a4669a8dc1934 +guid: 7e209c2cce12c254fbf93278199b21d6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Player/ScoreController.cs.meta b/Assets/Scripts/Player/ScoreController.cs.meta index 3a204b696470f99c502944d8a68ddf024e9a5b30..c7a2129ce74d7bdffd44dd61618fb3a6bb24bb9f 100644 --- a/Assets/Scripts/Player/ScoreController.cs.meta +++ b/Assets/Scripts/Player/ScoreController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d67a4f3940499a1459177d175a88673e +guid: d3ef8307452660d489e04484925e0617 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/ScoreController.cs b/Assets/Scripts/ScoreController.cs deleted file mode 100644 index e585467722330e9f85ec1e4d89e8bfa6c3149a72..0000000000000000000000000000000000000000 --- a/Assets/Scripts/ScoreController.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.UI; - -public class ScoreController : MonoBehaviour{ - private Player _player; - private int _start_pos; - private Text scoreText; - public double multiplier; - private double score; - - public string ScoreText{ - set => scoreText.text = value; - get => scoreText.text; - } - - public double BoostMultiplier{ - set{ - if (value > 0) - multiplier = value; - } - - get => multiplier; - } - - [SerializeField] private int pointDiffToHarden = 50; - private double pointToHarden; - public event Action HardenTheLevel; - - void Start() { - pointToHarden = pointDiffToHarden; - _player = GameManager.Instance.Player; - _start_pos = (int)_player.gameObject.transform.position.y; - scoreText = GetComponentInChildren<Text>(); - BoostMultiplier = 1; - score = 0; - } - - void Update(){ - var position = _player.gameObject.transform.position; - var scoreTmp = (int) position.y - _start_pos; - _start_pos = Math.Max((int)position.y, _start_pos); - if (scoreTmp > 0){ - score += scoreTmp * multiplier; - if (score / pointToHarden >= 1) { - pointToHarden += pointDiffToHarden; - HardenTheLevel?.Invoke(); - } - ScoreText = score.ToString(); - } - } -} diff --git a/Assets/Scripts/ScoreController.cs.meta b/Assets/Scripts/ScoreController.cs.meta deleted file mode 100644 index 3a204b696470f99c502944d8a68ddf024e9a5b30..0000000000000000000000000000000000000000 --- a/Assets/Scripts/ScoreController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d67a4f3940499a1459177d175a88673e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/menuButtons.cs b/Assets/Scripts/menuButtons.cs deleted file mode 100644 index 263fafa5bdba175620c98cfd96fdd4c07111cfd1..0000000000000000000000000000000000000000 --- a/Assets/Scripts/menuButtons.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class menuButtons : MonoBehaviour -{ - public void playButtonPress() - { - SceneManager.LoadScene(1); - } - public void quitButtonPress() - { - Application.Quit(); - } -} - diff --git a/Assets/Scripts/menuButtons.cs.meta b/Assets/Scripts/menuButtons.cs.meta deleted file mode 100644 index f83c0bd30a0a23a2533666cdbd4761e6eee4ae06..0000000000000000000000000000000000000000 --- a/Assets/Scripts/menuButtons.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 34767b4c9fb8a964581d2cbf1e9288e8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: