Word Guess \ Hangman game- How Do I Split a Word.

  • Hi everyone!

    I am adding a new feature to an ed game I'm working at- Hangman minigame.

    It's a pretty simple game- you drag and drop a letter to a "letter space". It must collide with the right space.

    My challange is to :

    1. after counting the characters of the word (with len(text)) - create the number of spaces above accordingly in the middle of the screen.

    2. let the program know which character supposed to be where.

    I searched the forum, tutorials and referance guides but still haven't found enough clues yet. Please assist me with ideas or maybe references to some relevant information

    Ran

  • For 1:

    On start of layout:

    Repeat len(text) times:

    Create object "spaceblank" at (30 + loopindex * 32, 32) - you have to adjust the offset positions according to your layout and object sizes.

    For 2:

    The letter supposed to go there for each letter space is: mid(Text, spaceblank.IID, 1)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you, Colonal ! :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)