math problem

How would you make just a simple addition problem in GS. For example a input box that they put a number in and another one and it displays the answer. It can be addition, multiplication, etc.

Comments

  • jsorr2jsorr2 Member Posts: 279

    so you want a calculator?

    well have 3 attributes X + Y = Z.

    Logic:
    X = keyboard input
    Y = second keyboard input
    Z = x + y

    Then in an actor, display Z's value when a button is pressed.

  • SocksSocks London, UK.Member Posts: 12,822

    @jsorr2 said:
    so you want a calculator?

    well have 3 attributes X + Y = Z.

    Logic:

    X = keyboard input

    Y = second keyboard input

    Z = x + y

    Then in an actor, display Z's value when a button is pressed.

    You wouldn't really need an attribute for 'z', you could just display x+y.

  • erkjerkerkjerk Member Posts: 41
    edited November 2014

    @jsorr2 sorry, could you elaborate - kind of confused, thanks.

    @Socks‌ how would you just display?

  • SocksSocks London, UK.Member Posts: 12,822

    @erkjerk said:
    Socks‌ how would you just display?

    Use the Display Text behaviour.

  • erkjerkerkjerk Member Posts: 41

    @Socks‌ thanks. I am confused by what jsor
    ment. Do I make an attribute and put keyboard function in that? Not sure where to put the addition forumla. Could you elaborate? Thanks again for the help

  • SocksSocks London, UK.Member Posts: 12,822

    @erkjerk said:
    Could you elaborate?

    You want me to elaborate on jsorr2's comment ? :)

  • erkjerkerkjerk Member Posts: 41

    @Socks‌
    Ya if you understand it lol. Unless you can let me know a way I can do it hah

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Here is a starter prototype.

  • erkjerkerkjerk Member Posts: 41
    edited November 2014

    @RThurman‌

    First, thanks for the help.

    It says "Unsupported file format. The file is newer than this version of Creator."

    I have 10.5 installed for PC.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Maybe this will help:

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    You need two variables to store info. The input just doesn't float around in there.

    So here is a simple function using two game level attributes. One called x and one called y

    Actor 1
    When touch is pressed

    Keyboard input to X

    Actor 2
    When touch is pressed

    Keyboard input to Y

    Actor 3

    Display text

    Game.x +game.y

    That's it.

  • erkjerkerkjerk Member Posts: 41

    @RThurman‌

    That is exactly what I am looking for, however how do you make it not rand generate, looks for when the box is touched, the user can input a number.

    Thanks guys for the help.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Replace the "Change Attribute" action with a "Keyboard Input" action.

  • erkjerkerkjerk Member Posts: 41

    @RThurman‌

    so put the game.a under the "change the ffollowing attribute" ? Or under "which prompts user with"?

    Thanks for the help appreciate it

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    Yes, game.a is the attribute.

    You can type any thing you want into the "prompt" section. For example you could type, "Enter a number between 1 and 100."

  • erkjerkerkjerk Member Posts: 41

    Worked great thanks

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    You are welcome!

Sign In or Register to comment.