How do I picking numbers game

Get help using Construct 2

Post » Thu May 07, 2015 6:23 am

Im wondering how i do that kind of game: http://www.salticid.com/concentration.htm

You picking rows and colums and you get in table with randomly placed numbers from 0 to x
You task is to click numbers from 0 to x
B
109
S
26
G
46
Posts: 1,886
Reputation: 35,168

Post » Thu May 07, 2015 10:20 am

Relatively easy to achieve that. Use for each order by (instanceVariable) ascending to determine increment instance variable value from small to bigger numbers.
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Thu May 07, 2015 10:26 am

Hey @alextro, :)

You could try setting it up in the following way...


Have the user specify the number of rows and columns, and store those values in variables named rows and columns.

Loop: from 1 to ( rows * columns )
>> Push ascending integers (use the loop index) into an Array object.

Here we are basically creating a deck of cards, such that we'll have a card with a unique integer for each cell in the grid.


Loop: from 1 to columns:
>> Loop: from 1 to rows:
>> >> Create a text object at ( X = columns * desiredGridSize ) by ( Y = rows * desiredGridSize)
>> >> Set local variable RandomElementIndex to: ( floor( random( Array width ) ) )
>> >> Set text to: Get Array element ( RandomElementIndex )
>> >> Delete element ( RandomElementIndex )

Notice that each time we pick an element from the array, we also delete it right afterwards.
This is just like drawing a card at random from a deck of cards, and then discarding the card so it won't show up twice.
B
27
S
18
G
8
Posts: 327
Reputation: 6,156

Post » Thu May 07, 2015 10:35 am

Good suggestion @fisholith
I will submit my method on a capx that will exclude the use of array.
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Thu May 07, 2015 9:07 pm

Number Concentration Table Game-worst game ever :lol:

capx> http://s000.tinyupload.com/index.php?fi ... 2255691985
Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Post » Thu May 07, 2015 10:06 pm

@korbaach wOW YOU DO IT BETER THAN ORIGINAL BRAVO!
B
109
S
26
G
46
Posts: 1,886
Reputation: 35,168

Post » Thu May 07, 2015 10:28 pm

Thanks @delgado
.. beter then original..but still boring :D
Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Post » Fri May 08, 2015 3:24 am

This kind of game intended for concentration test only. Here the sample: quick_ordered

@korbaach
Ha ha what a rush ambient music and unusual upper-lower case naming convention :mrgreen:
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Fri May 15, 2015 6:16 pm

@alextro i test your examp;le and its great i play few times and i found bug. Even if first number is 1 i cant sometimes check this and i mus restart game.
or
Image
B
109
S
26
G
46
Posts: 1,886
Reputation: 35,168

Post » Fri May 15, 2015 7:29 pm

@delgado .......... Worst Game Ever 2 :D
from similar topic........ viewtopic.php?f=147&t=130345

capx> http://s000.tinyupload.com/?file_id=635 ... 7887232157
Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Next

Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 14 guests