Math Equation from Variables

This forum is currently in read-only mode.
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hello! So, I'm trying to make a math game, and it's sort of like a calculator program right now. Basically, the player is given an equation, and must use an operator combined with 4 randomly generated numbers to a set value (200) until it is equal to the given equation. For example, if the problem were 10 * 10 = __, and the player uses /2, then 200/2 = 100 and they win.

    The way I'm doing the user interface, when the user clicks on an operator, it is sent to a global variable as a text. So if they clicked on +, global variable 'operator' is equal to "+". When they click on the "GO" button, it should submit the current operator and the current value into an equation.

    So the problem is that I don't know how to combine these into an equation that construct understands. I tried to do:

    On Button clicked:

    System: set global variable 'answer' to global('answer'), global('operator'), global('value')

    Text22: set text to global('answer')

    Program can be found here: http://dl.dropbox.com/u/4055367/arithimagic.cap

  • you're going to have to do it manually I would assume

    so

    global('operator') equal to "+"

    ----set global('answer') to global('answer')+global('value')

    global('operator') equal to "-"

    ----set global('answer') to global('answer')-global('value')

    etc..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aww, that's unfortunate. Ah well! Thanks!

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