mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-09-11 08:17:01 +00:00
Merge remote-tracking branch 'origin/main' into beni
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ActivateScript : Trigger
|
||||
{
|
||||
public GameObject obj;
|
||||
public bool deactivate;
|
||||
|
||||
public override void Action() {
|
||||
obj.SetActive(!deactivate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 220659e15c8199740ac9e81427e4ccb7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6,28 +6,21 @@ using UnityEngine.SceneManagement;
|
||||
public class BeatDark : MonoBehaviour
|
||||
{
|
||||
public int currentLevel;
|
||||
public int i = 2;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
currentLevel = PlayerPrefs.GetInt("CurrentLevel");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
/*void Update()
|
||||
{
|
||||
if (Input.GetButtonDown("Jump"))
|
||||
{
|
||||
BeatLevel();
|
||||
}
|
||||
}*/
|
||||
|
||||
void BeatLevel()
|
||||
public void BeatLevel()
|
||||
{
|
||||
|
||||
if (currentLevel == 3)
|
||||
if (i == currentLevel && i <= 6)
|
||||
{
|
||||
PlayerPrefs.SetInt("CurrentLevel", 4);
|
||||
PlayerPrefs.SetInt("CurrentLevel", i + 1);
|
||||
SceneManager.LoadScene("Real World");
|
||||
Debug.Log(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EndFukiTalk : EndTrigger
|
||||
{
|
||||
public GameObject TextBox;
|
||||
// public GameObject HeadBox;
|
||||
public List<string> pages;
|
||||
public List<int> emotes;
|
||||
public RuntimeAnimatorController controller;
|
||||
public Sprite startSprite;
|
||||
public AudioManager audioManager;
|
||||
public bool isTalking;
|
||||
GameObject instance;
|
||||
// GameObject instance;
|
||||
// GameObject headInstance;
|
||||
void Instant()
|
||||
{
|
||||
instance = Instantiate(TextBox, TextBox.transform.position, Quaternion.identity);
|
||||
instance.SetActive(true);
|
||||
instance.GetComponent<EndLevelDialogue>().pages = pages;
|
||||
instance.GetComponent<EndLevelDialogue>().emotes = emotes;
|
||||
instance.GetComponent<EndLevelDialogue>().controller = controller;
|
||||
instance.GetComponent<EndLevelDialogue>().audioManager = audioManager;
|
||||
instance.GetComponent<EndLevelDialogue>().isOpen = true;
|
||||
instance.GetComponent<EndLevelDialogue>().isTalking = isTalking;
|
||||
}
|
||||
public override void Action()
|
||||
{
|
||||
Instant();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 267d33fb299532b46b496eb25fb08133
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,88 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
//to implement inheritance
|
||||
public abstract class EndTrigger : MonoBehaviour
|
||||
{
|
||||
//tags for the trigger
|
||||
public bool forceInteract;
|
||||
public bool repeatable;
|
||||
bool isActive;
|
||||
//only worry about this if it is not repeatable
|
||||
bool hasOccurred;
|
||||
public int value;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
hasOccurred = false;
|
||||
}
|
||||
|
||||
//checks if player is in range of the trigger
|
||||
private void OnTriggerStay2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
//Debug.Log("entered");
|
||||
isActive = true;
|
||||
}
|
||||
// else {
|
||||
|
||||
// isActive = false;
|
||||
// Debug.Log("exit");
|
||||
|
||||
// if(forceInteract && repeatable) {
|
||||
// hasOccurred = false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private void OnTriggerExit2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
isActive = false;
|
||||
//Debug.Log("exit");
|
||||
}
|
||||
if (forceInteract && repeatable)
|
||||
{
|
||||
hasOccurred = false;
|
||||
}
|
||||
}
|
||||
// Update is called once per frame
|
||||
public void Update()
|
||||
{
|
||||
// Debug.Log("testr");
|
||||
//checks if conditions are right
|
||||
if (isActive && !hasOccurred)
|
||||
{
|
||||
//executes action upon entering
|
||||
if (forceInteract)
|
||||
{
|
||||
Action();
|
||||
hasOccurred = true;
|
||||
if (!repeatable)
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
}
|
||||
//only executes action if input is pressed
|
||||
else
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.E))
|
||||
{
|
||||
Debug.Log("action");
|
||||
Action();
|
||||
if (!repeatable)
|
||||
{
|
||||
hasOccurred = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void Action();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48a2041fb27275a4c9c69601a098eea2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FallTrigger : Trigger
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
public GameObject player;
|
||||
public Vector2 respawn;
|
||||
[SerializeField] bool canHurt = true;
|
||||
|
||||
public override void Action() {
|
||||
player.transform.position = respawn;
|
||||
if(canHurt) {
|
||||
player.GetComponent<Health>().takeHit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa757a0b9970dab4790d5da7745e9688
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -12,7 +12,7 @@ public class MoveOnToNextAreaScript : Trigger
|
||||
{
|
||||
isTrigger = true;
|
||||
box.isTrigger = true;
|
||||
Debug.Log(isTrigger);
|
||||
//Debug.Log(isTrigger);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ public class WorkingWallTrigger : MonoBehaviour
|
||||
public GameObject cat;
|
||||
public BoxCollider2D box;
|
||||
private int counter = 0;
|
||||
[Range(-25f, 25f)] public float camOffset = 10f;
|
||||
[Range(-50f, 50f)] public float camOffset = 10f;
|
||||
[Range(-15f, 15f)] public float catOffset = 5f;
|
||||
[Range(5, 180)] public int countOffset = 10;
|
||||
private Vector3 moveCam;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class bettertransform : MonoBehaviour
|
||||
{
|
||||
public float HorizontalSpeed = 1;
|
||||
public float MaxHorizontalPosition = 200;
|
||||
public float MinHorizontalPosition = -200;
|
||||
|
||||
// Please, name correctly your variables.
|
||||
// Yourself, in 3 months will be grateful
|
||||
private RectTransform rectTransform;
|
||||
|
||||
void Start()
|
||||
{
|
||||
rectTransform = GetComponent<RectTransform>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
Vector2 position = rectTransform.anchoredPosition;
|
||||
|
||||
position.x += HorizontalSpeed * Time.deltaTime;
|
||||
|
||||
if (position.x > MaxHorizontalPosition)
|
||||
position.x = MinHorizontalPosition;
|
||||
|
||||
rectTransform.anchoredPosition = position;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bdccd0c2644a6b24090e7088cec44bc3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user