How do I create random math problems

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hey guys im designing my first game!! been wanting to do this for a long time for my kids. This game is a platformer that you have to collect coins. they are inside chests. To open the chect you have to answer a random math question. My problem is that I cannot seem to create a random question. Im probably doing it all wrong but could someone point me in the right direction? thanks in advance.

    This is what ive been trying in a text field

    round(random(0,10)) " + " round(random(0,11)) " ="

    says there is a syntax error with the " + "

    what would be the best way of achieving what i want?

    I would also like to know how you guys would handle the answering of these questions. Do i put a text box in and do a function to compare the values, then tell it to move on with the game?

  • It should be:

    round(random(0,10)) & " + " & round(random(0,11)) & " ="

    Don't forget to put & to concatenate the strings

  • thank you very much. ill remember that for next time. Its been so much fun learning this. How would you setup the answering of the question? I would like the player to put the answer in a text box and it would check it its correct when the button is pressed.

  • Hey guys, still having issues with this. I followed the tutorial from But cant seem to get the text to display. Can someone please tell me what im doing wrong. Ive attatched the capx file below

  • I'm looking at your capx, I will try to look at your problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I found your problem You just forgot to include the event sheet where your function Create is written.

  • thank you soooo much!! This is something i didnt know. I knew it would be something simple. Thanks again

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