Announcement

Collapse
No announcement yet.

Making a 2D game of Hangman?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Making a 2D game of Hangman?

    Hello, everyone. I'm looking for advice on how I can make a game of hangman using Paper2D inside of Unreal. For instance, I'd like to know how I can pick random words and erase parts of the player's body. Really any help on this would be much appreciated. Thanks in advance!

    #2
    Unreal doesn't do well with strings and arrays which you both need to accomplish a basic hangman game.

    The basic part is simple.
    make an array of words and select one at random to start.

    given the string you find the character within it (takes half a second in c++, not sure the blueprint has a way to find a single character).

    To get to where you find a character you would have to structure a UMG widget where the user can type, or a list of characters across the screen that the user can select.

    to associate a wrong choice to the process of adding/removing parts I would use a function call.

    if the character isn't in the string you call that function and do or generate whatever you need for the body to appear or disappear.

    I would suggest using a custom c++ actor to get this done.

    Comment


      #3
      Originally posted by MostHost LA View Post
      Unreal doesn't do well with strings and arrays which you both need to accomplish a basic hangman game.

      The basic part is simple.
      make an array of words and select one at random to start.

      given the string you find the character within it (takes half a second in c++, not sure the blueprint has a way to find a single character).

      To get to where you find a character you would have to structure a UMG widget where the user can type, or a list of characters across the screen that the user can select.

      to associate a wrong choice to the process of adding/removing parts I would use a function call.

      if the character isn't in the string you call that function and do or generate whatever you need for the body to appear or disappear.

      I would suggest using a custom c++ actor to get this done.
      Thanks for the response. I found this template, which essentially is everything mentioned above: https://github.com/Danqin1/UE4-Hangman

      Comment


        #4
        Originally posted by HorrorGameDev View Post
        I found this template, which essentially is everything mentioned above: https://github.com/Danqin1/UE4-Hangman
        Looks like a useful C++ project. However, for those looking for a 'Blueprints only' solution who land on the thread later on...

        Originally posted by MostHost LA View Post
        Unreal doesn't do well with strings and arrays which you both need to accomplish a basic hangman game...
        given the string you find the character within it (takes half a second in c++, not sure the blueprint has a way to find a single character)
        The advice above is relevant for UDK-Kismet maybe, not UE4! Overall Blueprints are absolutely fine for handling Strings.
        What programmers don't like sometimes maybe are all the spaghetti wires involved in handling strings so maybe that's it.
        But using Blueprint functions will really help, and the Find Substring BP node should easily locate the character position.
        BTW: Just hardcode a few sample words into an array for now. If the game works out you can look at DataTables later on.
        Last edited by ClavosTech; 02-13-2020, 09:13 AM.

        Comment

        Working...
        X