math problem
erkjerk
Member Posts: 41
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
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.
@jsorr2 sorry, could you elaborate - kind of confused, thanks.
@Socks how would you just display?
Use the Display Text behaviour.
@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
You want me to elaborate on jsorr2's comment ?
@Socks
Ya if you understand it lol. Unless you can let me know a way I can do it hah
Here is a starter prototype.
@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.
Maybe this will help:
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.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@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.
Replace the "Change Attribute" action with a "Keyboard Input" action.
@RThurman
so put the game.a under the "change the ffollowing attribute" ? Or under "which prompts user with"?
Thanks for the help appreciate it
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."
Worked great thanks
You are welcome!