I'm trying to create a falling word typing game like z-type.

I have used the code provided here : https://github.com/Brackeys/Falling-Words-Typing-Game

In the WordSpawner.cs file, I'm trying to set the limit of the length of words that are displayed. for eg. in the first 15 seconds I want the length of words to be 3/4 and between 15-30 seconds 5/6 and after that any random length from 3 - 9. Is there any way to achieve this?

Also, I want to show the wave number on the screen like in the z-type game. How can I achieve this functionality.

This is the script from the tutorial:

public GameObject wordPrefab; 
public Transform wordCanvas; 

public WordDisplay SpawnWord () {
    Vector3 randomPosition = new Vector3(Random.Range(-2.5f, 2.5f), 7f); 
    GameObject wordObj = Instantiate(wordPrefab, randomPosition, Quaternion.identity, wordCanvas); 
    WordDisplay wordDisplay = wordObj.GetComponent<WordDisplay>(); 
    return wordDisplay;
} 

The list of words is an array that contains about 50 words. This list is in a separate file.

  • 1
    Hey! Thats actually very easy. Could you post the script you are using? Or from the tutorial? I could write down an example but i wouldnt work if you want to use it for an existing project, – Prometheus Dec 6 at 6:50
  • 1
    To answer Prometheus's question, you should really include the code that's used to select a particular text string to use for the next word. That's not shown in the sample you've given here. Try looking in the WordGenerator and WordManager scripts. – DMGregory Dec 6 at 13:21

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.