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
122
S
33
G
53
Posts: 1,905
Reputation: 39,756

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
136
S
56
G
24
Posts: 812
Reputation: 24,617

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
34
S
22
G
8
Posts: 352
Reputation: 6,785

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
136
S
56
G
24
Posts: 812
Reputation: 24,617

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
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

Post » Thu May 07, 2015 10:06 pm

@korbaach wOW YOU DO IT BETER THAN ORIGINAL BRAVO!
B
122
S
33
G
53
Posts: 1,905
Reputation: 39,756

Post » Thu May 07, 2015 10:28 pm

Thanks @delgado
.. beter then original..but still boring :D
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

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
136
S
56
G
24
Posts: 812
Reputation: 24,617

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
122
S
33
G
53
Posts: 1,905
Reputation: 39,756

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
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

Next

Return to How do I....?

Who is online

Users browsing this forum: Lee Chien Hung and 1 guest