Trying to destroy specific word

0 favourites
  • 7 posts
From the Asset Store
Word Guess
$10 USD
Questions and answers are stored in simple txt-files. Cool animation of everything
  • I'm trying to make a typing game where you have to type the displayed word to defeat the enemy. I'm in the middle of prototyping and Currently I have the enemy in a container with a text file. so if one is deleted the other is destroyed as well. so far I've set up the game to display the random text along with every new enemy created. the part I'm having trouble with is checking to see if the player input is equal to text and then destroying the correct enemy. I've tried using a for each loop but its failing to check if the text entered and the text displayed are equal. What am I doing wrong.

  • Hi! I dunno specifically what might be wrong with your project without looking at it but I've tried to make what you're aiming to do. Check out this project file, read through the comments in its event sheet, and let me know if it helps or if you have any other questions!

  • Thank you for your help. I am still having trouble though. I took a look at your code and saw that it wasn't to different from mine other than a few minor differences. I changed it to mirror your code though and I still can not get the darn enemies to destroy. here is the link to my file maybe I need another set of eyes on this cause I for the life of me can not figure this out

  • I figured it out for you, because of the format in words.txt and using tokenat with ; divider the words are actually including the spaces on each line after the word so the set word is something like "word---------" where the dashes are tons of blank spaces. The words.txt format should be something like "word1;word2;word3;" to use that tokenat expression correctly.

  • That was it. But now I'm having trouble getting only one of the items to disappear. instead of deleting just one all of the items get deleted.

  • It doesn't do that with the file you sent, even though you are picking word and destroying enemy it still picks correctly as they are in a container, I don't see that bug (but really you should destroy word not enemy).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You set text for word here:

    trim(Dictionary.At(round(random(0,999))))

    Add trim to remove blank.

Jump to:
Order by:
Duplicate Topics
Posts
Views
Last Post
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)