Number checking game

321boo

  • Posts: 5
I'm trying to create a game where the player has to count the number of items on a screen and then type the correct number.

The number of points they get is equivalent to the answer they inputted (if correct).

Any ideas on how I can go about creating a text box so the player can input a number?

How can I then turn their number into the score? I've started on this part (see image)





Luyren

  • *
  • Posts: 2346
See attachment.

"Input Text"  is a boolean that should be set to true whenever your text box opens.
"Used Value" is a text attribute. You should set it to the "empty text" block whenever you open the text box.

When the player presses enter or your confirm key, check "Used Value" against your target number (use the "as text" block). You might need to round the number. That's the general idea.

The code in the attachment also convers the backspace key to delete text.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

321boo

  • Posts: 5
Thank you!!!

I think I got it to work (: