Game Summary

Explore a dilapidated apartment reeked with secrets as you solve puzzles to uncover the downfall behind this toxic relationship…

Development Information

Role: Programmer

Project Type: Game Jam - Husky Jam 2021

Tools: Unity, FMOD, Jetbrains Rider, Github, ARFoundation

Duration: July 2021

Team Size: 4

Genre: Adventure-Puzzle

Platform: Android

Project Status: Completed

Contributions

Packages

  • ARFoundation
  • ARCore
  • ARKit

The interaction system allows for the user to interact with the environment. This is broken down into two main components: the user script and the object script. The object script will be attached to all interactable objects to enable their behavior. The user Interaction Manager is what allows the user to actually activate the scripts on the objects according to the user tap. 

This script is on the user and is called whenever the user taps on the screen. It looks for an interactable object and if it is found, the associated action is invoked.

public void handleInteraction(GameObject interactedObject){
    if(interactedObject.GetComponent<ObjectInteract>() != null){
    if((interactedObject.GetComponent<ObjectInteract>().previousSequence.activated || interactedObject.GetComponent<ObjectInteract>().previousSequence == null)){
            interactedObject.GetComponent<ObjectInteract>().action.Invoke();
            sfx.Play();
        }
    }
}

This script is on every interactable object and defines its behavior. The bool and instance of itself are used to define the sequence of which objects can be interacted.  

public class ObjectInteract : MonoBehaviour
{

    public bool activated;
    public UnityEvent action;
    public ObjectInteract previousSequence;
}

This system handles the implementation of a number code lock, which is used to gate progression until the user is able to solve the associated puzzle.

This manager was implemented using a singleton pattern and is called by Interactable objects that have a stored associated lockCode object.

public List code;
public List entered;
public Text codeDisplay;
public Text hint;
private UnityEvent unlockEvent;
public GameObject lockPanel;

public void activateLock(lockCode locker)
{
        code = locker.Encode;
        lockPanel.SetActive(true);
        hint.text = "Hint: " + locker.Hint;
        unlockEvent = locker.unlock;  
    }
    
public void enterCode(int val){
    if(entered.Count < 3){
        entered.Add(val);
    }
}

This lock information is stored on the interactable object and is passed to the singleton Lock Manager.

public class lockCode : MonoBehaviour
{
   public string Hint;
   public List<int> Encode;

    public UnityEvent unlock;
}