Really cool! I have a question, how you are doing dialouge? Because maybe I could help you do it better or something, but that's probarly not allowed, because the GAME JAM, but rally cool, now the game is more responsive when a enemy is hit. Maybe add an health bar to the player, so he has health. And some armor to, so like on his adventure somewhere he could find armour, and equip it. When there's armor equiped, when an enemy shoots at the player, not the players health goes down, bu the armor points. And when the armor points are 0, then the health goes down. But you made pretty good progress, cool! :)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CharacterInnerThoughts : MonoBehaviour
{
public Text textDisplay;
public string[] sentences;
private int index;
public float speed;
public float destroyTime;
public GameObject theCanvas;
IEnumerator Type()
{
foreach(char letter in sentences[index].ToCharArray())
{
textDisplay.text += letter;
yield return new WaitForSeconds(speed);
RemoveText();
}
}
void OnTriggerEnter2D(Collider2D col)
{
if(col.gameObject.tag == "Player")
{
StartCoroutine(Type());
}
}
void RemoveText()
{
Destroy(textDisplay, destroyTime);
Destroy(theCanvas, destroyTime);
}
}
Here's the code: https://drive.google.com/file/d/1w7wA0ZgzTczIuiYd-LKEi-o3tQZGH81e/view?usp=shari...
It's a UnityPackage
Explanations are in the code as comments, if you need help with any other code, just ask. There are two scripts, and both of them are needed, if you need help setting it up, I can record my screen and send you the video. :)