basic math with simple user input for answer
revoltandreverb
Member Posts: 159
Hi Guys. I'm trying to a basic math demo by generating 2 random numbers and multiplying them. The user then has to input the answer probably using a "keyboard" I will have to make using 10 actors numbered 1,2,3,4,5,6,7,8,9,0 or what's the tried and tested method?
For the first number actor I've constrained a game attribute 'number1' to random(1,10). I did the same for the second number actor using game attribute 'number2'.
For the correct answer actor I created an attribute 'correctanswer' and constrained to (number1 * number2). From here on I'm a bit lost. Can someone please point me to a tutorial/template of basic math and user input for the answer?
Thanks!
Comments
Is this the kind of thing you're after? You're very nearly there.
Making a "keyboard" is the usual method but you could explore other possibilities. It would really depend on the game you want to end up with.
Obviously you'd want to neaten things up a lot and make a proper "win" action.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Thanks Armelline, I'll check it out. I always first try my best before posting so hopefully a more experienced dev can see that I at least tried and I wasn't just hoping someone would do it for me.
It's perfect, thanks! Is there any "official" documentation on user input so I can familiarise myself with it?
If you go to the help menu at the top of the GS website you'll see the Cookbook. That's the "manual" that explains how things work. It'll have most of the information you're looking for, but you'll have to find it scattered throughout. If you check YouTube there are a lot of great GS tutorials on there too, a number of which look at user input of various forms.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
thanks