Random number game help need for the save !
mertgunes2434
Member Posts: 4
Hi
I'm building a catch number game.Game is work like this.
Scene 1 random letter
Scene 2 random letter
Scene 3 random letter
Scene 4 random Number
Scene 5 random letter
Scene 6 random Number
Scene 7 random letter
So scenies going fast and player trying see the numbers then write they guess.A problem is how I can process the right numbers to the program memory,and How I compare to the player answer ?
Thanks.
Comments
I made a game sort of like what you described but it was about colours.
Toddler Fun Colors
Its in the google play store as well.
I just used a crap load of attributes. Im sure tables would of been easier but I just used attributes and simple rules to check if the correct one was picked.
How i can do that I already use table and use this code on the scene.
Disiplaytext behavior for letter
tableCellValue(game.table 2,random(1,12),1)
For number
tableCellValue(game.table 3,random(1,9),1)
And what I should to code ?
I'd simply look at adding them to either a TEXT attribute (easier), OR (more flexible) - a fresh, temp table, maybe 2 columns. You select a random letter or number as above, store it in the current row, say column 1. Increment counter.
When all have been shown, reset counter to 1.
Then when the user presses what they think, you also store those, and increment the counter each press. then you can easily compare, either in order, or via an instant search, to see if what the user pressed is in the shown (and saved) items?
Either a direct comparison will work (ie. TEXT comparison/expression:- (temp table, current row, col 1) = (temp table, current row, col 2) ), or a tableColSearch (IIRC) if the order is unimportant, OR just go through each pair one by one, looping through the table...
Again, storing to a TEXT attribute is even easier if it has to be in the same order? - ie. add each random to the first text attribute - say, ending up with "AB5E12D", then just grab what the user presses/types, (ie. "AB61E2D"), and compare the text attributes? - If they don't match, they got it wrong...