巨酷的打字软件:Typing of the Dead

介绍了一款打字游戏Typing of the Dead,它保留《死亡之屋II》过关情节,通过敲指定字串过关,配有高效打字教程,支持二人网络对战并提供打字质量统计。该游戏可在The Underdogs用BT下载,还可使用gamecopyworld的nocd补丁。

从来没有见过这么好玩儿的打字游戏。作者聪明地保留了《死亡之屋II》的全部过关情节,但我们不再用鼠标控制霰弹枪杀死僵尸,而是通过敲出指定的字串来过关斩将。Typing of the Dead还配有一个极为高效的打字教程。更绝的是,这个游戏支持二人网络对战,并提供一系列打字质量统计。这是一个开发游戏,我们可以在The Underdogs用BT下载。而且不要忘了gamecopyworld的nocd补丁。最后,如果配上这个键盘,想不运指如飞都不行啊。

Typing of the Dead

using System.Collections; using TMPro; using Unity.VisualScripting; using UnityEngine; public enum Battle { Start, PlayerTurn, EnemyTurn, Lose, Win } public class BattleSystem : MonoBehaviour { public Battle State; public float typingSpeed = 0.05f; private bool isTyping = false; public GameObject PlayerPrefeb; public GameObject EnemyPrefeb; public Transform PlayerPosition; public Transform EnemyPosition; private Playermessage playerpeople; private Enemymessage emenypeople; public EnemyBattleHUD enemyHUD; public PlayerBattleHUD playerHUD; public TextMeshProUGUI Text; // 用于显示对话的文本组件 public GameObject F; public GameObject m; private string currentSentence; private Coroutine typingCoroutine; void Start() { State = Battle.Start; StartCoroutine(SetupBattle()); } private IEnumerator SetupBattle() { GameObject player = Instantiate(PlayerPrefeb, PlayerPosition); playerpeople = player.GetComponent<Playermessage>(); GameObject emeny = Instantiate(EnemyPrefeb, EnemyPosition); emenypeople = emeny.GetComponent<Enemymessage>(); playerHUD.SetHUD(playerpeople); enemyHUD.SetHUD(emenypeople); // 显示开场信息(带打字效果) yield return StartCoroutine(TypeText("Let me feel your power now, don't make me bored^_^", 0.5f)); yield return new WaitForSeconds(0.5f); if (F != null) F.SetActive(false); if (m != null) m.SetActive(true); yield return StartCoroutine(TypeText("I can't lose here", 0.5f)); yield return new WaitForSeconds(0.5f); if (m != null) m.SetActive(false); yield return StartCoroutine(TypeText("--Please consider your decision--", 5f)); State = Battle.PlayerTurn; PlayerTurn(); } // 玩家回合逻辑 private void PlayerTurn() { StartCoroutine(TypeText("Choose your action...", 0f)); } public void OnAttackButton() { if (State != Battle.PlayerTurn) return; StartCoroutine(PlayerAttack()); } private IEnumerator PlayerAttack() { if (isTyping) { StopCoroutine(typingCoroutine); } currentSentence = Text.text; yield return StartCoroutine(TypeText("Get out of my way!!!", 0f)); yield return new WaitForSeconds(1f); bool IsDead = emenypeople.TakeDamage(playerpeople.atk, emenypeople.def); enemyHUD.SetHUD(emenypeople); // 显示伤害数值 int damageDealt = Mathf.Max(playerpeople.atk - emenypeople.def, 100); yield return StartCoroutine(TypeText($"Dealt {damageDealt} damage!", 0f)); yield return new WaitForSeconds(1f); if (IsDead) { State = Battle.Win; EndBattle(); } else { State = Battle.EnemyTurn; StartCoroutine(EnemyTurn()); } } private IEnumerator EnemyTurn() {if (isTyping) { StopCoroutine(typingCoroutine); } currentSentence = Text.text; yield return StartCoroutine(TypeText("Look into my eyes...", 0f)); yield return new WaitForSeconds(1f); bool IsDead = playerpeople.TakeDamage(emenypeople.atk, playerpeople.def); playerHUD.SetHUD(playerpeople); int damageDealt = Mathf.Max(emenypeople.atk - playerpeople.def, 50); yield return StartCoroutine(TypeText($"Took {damageDealt} damage!", 0f)); yield return new WaitForSeconds(1f); if (IsDead) { State = Battle.Lose; EndBattle(); } else { State = Battle.PlayerTurn; PlayerTurn(); } } private void EndBattle() { if (State == Battle.Win) { StartCoroutine(TypeText("Victory is mine!", 0f)); } else if (State == Battle.Lose) { StartCoroutine(TypeText("Defeat... I'll be back!", 0f)); } } void Update() { // 添加跳过功能:按任意键跳过当前打字效果 if (Input.GetMouseButtonDown(0) && isTyping) { SkipTyping(); } } public void SkipTyping() { if (isTyping) { StopCoroutine(typingCoroutine); Text.text = currentSentence; isTyping = false; } } // 打字效果协程 public IEnumerator TypeText(string sentence, float initialDelay = 0f) { if (Text == null) yield break; isTyping = true; yield return new WaitForSeconds(initialDelay); Text.text = ""; foreach (char letter in sentence.ToCharArray()) { Text.text += letter; yield return new WaitForSeconds(typingSpeed); } isTyping = false; } }检查文字跳过打印的错误
07-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值