Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Typing of the Dead style game in Unity

Discussion in 'Scripting' started by ColtonPhillips, Jun 30, 2013.

  1. ColtonPhillips

    ColtonPhillips

    Joined:
    Jul 30, 2012
    Posts:
    5
    I'm interested in making a "typing game" a game where the main mechanic is typing out words and checking them with a dictionary.

    What are some tips for going about doing this? How can I display live gui elements of which letters are typed?
    How can I take user input without a huge switch statement for each letter?

    I'll ask more questions as the conversation grows. While I'm making noise, I hope I'm not breaking any Unity thread rules in the process! This is my first post!

    Cheers,
    C
     
  2. ColtonPhillips

    ColtonPhillips

    Joined:
    Jul 30, 2012
    Posts:
    5
    hmm. bump, because zero views.
     
  3. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    1. What are some tips for going about doing this?: Start Trying things: What you isn't knowledge, it'll be your experience.
    2. How can I display live GUI elements of which letters are typed?: You are planning to making a game!!!!, so you must have the basic knowledge of Unity.
    3.
    How can I take user input without a huge switch statement for each letter?: Google is your best friend. Its a concept, nothing to do specifically with Unity.
     
  4. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    Unity's built-in GUI solution won't do what you want well enough. I would suggest looking into something like NGUI's free version to help you along here. There are plenty of tutorials for that, so you should be fine.

    As for accepting input, I don't understand why you'd want a switch statement at all. You simply check the key they pressed against the next expected letter. If it matches, you advance. If it doesn't, you don't advance.

    If approached correctly, this actually sounds like a good beginner project with lots of possibilities for expansion. Normally I'd tell people to start smaller, but this could actually work as a good first project.
     
  5. ColtonPhillips

    ColtonPhillips

    Joined:
    Jul 30, 2012
    Posts:
    5
    Hey folks.

    I don't think I want to use NGUI, I don't mind how long it takes to implement. I see what you mean saying its not a specific to unity problem. I won't have any problem simply printing a string to the screen using gui elements. I have the basic unity knowledge. What I want to start on first is to mimic some sort of text window that i can type into, just like the window im using to quick reply right now.

    wccrawford. I see. If I can get any key input that occurs as a string, and i don't miss any really fast keystrokes than that makes sense to me.

    Coming together, bit by bit. HOW can I make this text input dialog type of deal.
     
  6. ColtonPhillips

    ColtonPhillips

    Joined:
    Jul 30, 2012
    Posts:
    5
    the reason im using the forum and not just google is that talking to you is helping me define the requirements along the way.
     
  7. ColtonPhillips

    ColtonPhillips

    Joined:
    Jul 30, 2012
    Posts:
    5
    will post my results soon. I've essentially solved the big part of the typing problem.
     
  8. SomeDude

    SomeDude

    Joined:
    Feb 16, 2012
    Posts:
    95
    Cool. I like these types of games. Are you using GUI.TextField or GUI.TextArea or what?

    I still haven't started learning Unity yet so not sure if those would work well for what you're wanting.
     
    Last edited: Jul 11, 2013
  9. cosmogonies.net

    cosmogonies.net

    Joined:
    May 8, 2013
    Posts:
    7
    Hello ColtonPhillips.

    I did my own Unity3D "Typing game", and I encounter some issues during development with the keyboard.

    The main thing is that Unity's UI is very basic. All GUIPrimitives will be called twice (one for logic, and one for drawing).
    Besides, the use of transparency must be very limited (maybe it is not longer a limitation with newer versions).
    After doing my all keyboard GUI System, half of calculation time in the Profiler was for GUI !
    So I did my own GUI System, based on real 3D letters and interactive 2D area. And that works damn well !

    You can checkout my game "Bloody Typing" by the way ^^ Youtube Link
    https://play.google.com/store/apps/details?id=com.Cosmogonies.BloodTyping
    https://itunes.apple.com/us/app/bloody-typing/id576195227

    Be free to comment^^.
     
  10. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
  11. babji3

    babji3

    Joined:
    May 28, 2015
    Posts:
    179
    Hi, am planing to do like a different typing for kid , so
    can you plz share me a source code????
    thx
     
  12. mellovely

    mellovely

    Joined:
    Jan 31, 2017
    Posts:
    21
    Hey guys!
    I am making a game like this, but mine is a lot simpler in that the user only needs to input one letter to kill the enemy.
    Each enemy represents a different letter "a", "b" etc
    I am instantiating the enemies from prefabs so that they appear randomly on screen and I have a function that checks if the letter input matches the name of the enemy. It is doing this fine but my enemies are not being killed as they "die" animation is not being played because I get an error message saying it is not a "playable" I think this might be down to calling each enemy from the prefab. So just wondering how you guys tackled this? as like i said it seems much more complicated to do a full word than just a letter. Maybe I took some long unnecessary way to do things?