| Criteria | Rank | Score* | Raw Score |
|---|---|---|---|
| Graphics | #131 | 4.067 | 4.067 |
| Audio | #233 | 3.400 | 3.400 |
| Game Design | #299 | 3.467 | 3.467 |
| Overall | #363 | 3.322 | 3.322 |
| Fun | #388 | 3.244 | 3.244 |
| Innovation | #506 | 3.022 | 3.022 |
| Theme | #754 | 2.733 | 2.733 |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEngine.SceneManagement;
public class Registration : MonoBehaviour {
public TMP_InputField nameField;
public GameManager gameManager;
public Button submitButton;
public void CallRegister()
{
StartCoroutine(Register());
}
IEnumerator Register()
{
WWWForm form = new WWWForm();
form.AddField("name", nameField.text);
form.AddField("score", gameManager.score.ToString());
Debug.Log(nameField.text);
Debug.Log(gameManager.score.ToString());
WWW www = new WWW("https://michielhijweege.com/gamejam20221/register.php", form);
yield return www;
if(www.text == "0")
{
Debug.Log("User created successfully.");
Debug.Log("restart");
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
else
{
Debug.Log("User creation faild. Error #" + www.text);
}
}
public void VerifyInputs()
{
submitButton.interactable = (nameField.text.Length >= 1 && gameManager.score.ToString().Length >= 1);
}
}
Heb momenteel niet het project gevonden probeer later.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Move : MonoBehaviour
{
// Variables
public float moveSpeed = 1f;
public GameObject character;
private Rigidbody characterBody;
private float screenWidth;
// Use this for initialization
void Start()
{
screenWidth = Screen.width;
characterBody = character.GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
// Apply a constant forward force
characterBody.AddForce(Vector3.forward * 800f * Time.fixedDeltaTime);
// Check for touch input
if (Input.touchCount > 0)
{
Touch thisTouch = Input.GetTouch(0);
if (thisTouch.phase == TouchPhase.Moved)
{
Vector3 touchPosition = thisTouch.position;
touchPosition.z = 1.5f; // Set a distance from the camera
Vector3 worldPos = Camera.main.ScreenToWorldPoint(touchPosition);
Vector3 newPos = transform.position;
newPos.x = worldPos.x;
transform.position = newPos;
}
}
}
void FixedUpdate()
{
#if UNITY_EDITOR
RunCharacter(Input.GetAxis("Horizontal"));
#endif
}
private void RunCharacter(float horizontalInput)
{
// Move player based on horizontal input
characterBody.AddForce(new Vector2(horizontalInput * moveSpeed, 0));
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
public class networkHUD : NetworkManager
{
private GameObject player1;
public int teamcount = 0;
public int team1count = 0;
public int team2count = 0;
public int playerint = 0;
private void Update()
{
player1 = GameObject.Find("Player1");
if (!player1)
{
teamcount = 0;
team1count = 0;
team2count = 0;
playerint = 0;
}
SetupOtherSceneButtons();
}
public void StartupHost()
{
SetPort();
NetworkManager.singleton.StartHost();
}
public void JoinGame()
{
SetIPAddress();
SetPort();
NetworkManager.singleton.StartClient();
}
void SetIPAddress()
{
string ipAddress = GameObject.Find("InputFieldIPAddress").transform.FindChild("Text").GetComponent().text;
NetworkManager.singleton.networkAddress = ipAddress;
}
void SetPort()
{
NetworkManager.singleton.networkPort = 7777;
}
void OnLevelWasLoaded(int level)
{
if (level == 0)
{
//SetupMenuSceneButtons();
StartCoroutine(SetupMenuSceneButtons());
}
else
{
SetupOtherSceneButtons();
}
}
IEnumerator SetupMenuSceneButtons()
{
yield return new WaitForSeconds(0.3f);
GameObject.Find("ButtonStartHost").GetComponent<Button>().onClick.RemoveAllListeners();
GameObject.Find("ButtonStartHost").GetComponent<Button>().onClick.AddListener(StartupHost);
GameObject.Find("ButtonJoinGame").GetComponent<Button>().onClick.RemoveAllListeners();
GameObject.Find("ButtonJoinGame").GetComponent<Button>().onClick.AddListener(JoinGame);
}
void SetupOtherSceneButtons()
{
GameObject.Find("ButtonDisconnect").GetComponent<Button>().onClick.RemoveAllListeners();
GameObject.Find("ButtonDisconnect").GetComponent<Button>().onClick.AddListener(NetworkManager.singleton.StopHost);
}
}
| Criteria | Rank | Score* | Raw Score |
|---|---|---|---|
| Graphics | #465 | 3.000 | 3.000 |
| Audio | #289 | 3.143 | 3.143 |
| Game Design | #611 | 2.571 | 2.571 |
| Overall | #516 | 2.786 | 2.786 |
| Fun | #558 | 2.643 | 2.643 |
| Innovation | #500 | 2.714 | 2.714 |
| Theme | #596 | 2.643 | 2.643 |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class keycode : MonoBehaviour
{
public List<GameObject> numobj;
public string correctcode;
public string currentcode;
public door door1;
public door door2;
public Animator anim;
[SerializeField] List<string> alphabet;
public void checkcode()
{
anim.SetTrigger("rest");
currentcode = "";
for (int i = 0; i < numobj.Count; i++)
{
currentcode += alphabet[numobj[i].GetComponent<keynum>().numkey];
}
if(currentcode == correctcode)
{
door1.doorlock = false;
door2.doorlock = false;
anim.SetBool("correct", true);
Debug.Log("correct");
}
if (currentcode != correctcode)
{
Debug.Log("wrong");
anim.SetTrigger("wrong");
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Ink.Runtime;
using TMPro;
public class DialogueManager : MonoBehaviour
{
[Header("Dialogue UI")]
[SerializeField] private GameObject dialoguePanel;
[SerializeField] private TextMeshProUGUI dialogueText;
[SerializeField] private GameObject nextbuttonobj;
[Header("choices UI")]
[SerializeField] private GameObject[] choices;
private TextMeshProUGUI[] choicesText;
[Header("give items")]
public GameObject goodobj;
public GameObject mediumobj;
public GameObject badobj;
public GameObject mirrorobj;
public Vector3 givposs;
public Vector3 givrot;
public inventory iv;
List<float> audiotimer;
private Story currentStory;
private int i;
public bool dialogueIsPlaying { get; private set; }
private static DialogueManager instance;
List<string> tags;
[SerializeField] private bool isspeaking;
private void Awake()
{
if (instance != null)
{
Debug.Log("meer dialogue manager");
}
instance = this;
}
public static DialogueManager GetInstance()
{
return instance;
}
private void Start()
{
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
tags = new List<string>();
choicesText = new TextMeshProUGUI[choices.Length];
int index = 0;
foreach (GameObject choice in choices)
{
choicesText[index] = choice.GetComponentInChildren<TextMeshProUGUI>();
index++;
}
}
public void nextbutton()
{
ContinueStory();
Debug.Log("next text press");
}
public void EnterDialogueMode(TextAsset inkJSON, Vector3 possgiveitem, Vector3 rotgiveitem, List<float> audiotimerget)
{
isspeaking = true;
nextbuttonobj.SetActive(false);
audiotimer = audiotimerget;
givposs = possgiveitem;
givrot = rotgiveitem;
currentStory = new Story(inkJSON.text);
dialogueIsPlaying = true;
dialoguePanel.SetActive(true);
StartCoroutine(nexttextauto());
ContinueStory();
}
public IEnumerator nexttextauto()
{
if (i <= audiotimer.Count)
{
Debug.Log("next text audio" + i + audiotimer[i]);
yield return new WaitForSeconds(audiotimer[i]);
i++;
StartCoroutine(nexttextauto());
ContinueStory();
}
if (i >= audiotimer.Count)
{
isspeaking = false;
StopCoroutine(nexttextauto());
}
}
public IEnumerator ExitDialogueMode()
{
yield return new WaitForSeconds(0.2f);
dialogueIsPlaying = false;
dialoguePanel.SetActive(false);
dialogueText.text = "";
i = 0;
}
private void ContinueStory()
{
if (currentStory.canContinue)
{
dialogueText.text = currentStory.Continue();
ParseTags();
DisplayChoices();
}
else
{
StartCoroutine(ExitDialogueMode());
}
}
private void DisplayChoices()
{
List<Choice> currentChoices = currentStory.currentChoices;
if (!isspeaking && currentChoices.Count == 0)
{
nextbuttonobj.SetActive(true);
StopCoroutine(nexttextauto());
}
if (currentChoices.Count > choices.Length)
{
Debug.LogError("More choices were given than the UI can support. Number of choices given: "
+ currentChoices.Count);
}
int index = 0;
foreach (Choice choice in currentChoices)
{
isspeaking = false;
choices[index].gameObject.SetActive(true);
choicesText[index].text = choice.text;
index++;
}
for (int i = index; i < choices.Length; i++)
{
choices[i].gameObject.SetActive(false);
}
}
public void MakeChoice(int choiceIndex)
{
currentStory.ChooseChoiceIndex(choiceIndex);
ContinueStory();
}
void ParseTags()
{
tags = currentStory.currentTags;
foreach (string t in tags)
{
string prefix = t;
switch (prefix)
{
case "giveg":
spawngood();
break;
case "gived":
spawnbad();
break;
case "givem":
spawnmedium();
break;
case "givemir":
spawnmirror();
break;
case "removecoin":
removecoin();
break;
case "removemirror":
removemirror();
break;
}
}
}
void spawngood()
{
Debug.Log("good"); Instantiate(goodobj, givposs, Quaternion.Euler(givrot));
//Instantiate(goodobj, new Vector3(-32.5f, 13, -19), Quaternion.Euler(0f, 0f, 180f));
}
void spawnmedium()
{
Debug.Log("medium");
Instantiate(mediumobj, givposs, Quaternion.Euler(givrot));
}
void spawnbad()
{
Debug.Log("bad");
Instantiate(badobj, givposs, Quaternion.Euler(givrot));
}
void spawnmirror()
{
Debug.Log("mirror");
GameObject newmirror = Instantiate(mirrorobj, givposs, Quaternion.Euler(givrot));
newmirror.name = "Mirror";
}
void removecoin()
{
Debug.Log("remove coin");
if (iv.coinamount >=1)
{
iv.coinamount -= 1;
}
else
{
GameObject go = GameObject.Find("coin");
Destroy(go.gameObject);
}
}
void removemirror()
{
Debug.Log("remove mirror");
if (iv.Mirroramount >= 1)
{
iv.Mirroramount -= 1;
}
else
{
GameObject go = GameObject.Find("Mirror");
Destroy(go.gameObject);
}
}
}