How do I perform series of sorting ?

Get help using Construct 2

Post » Sat Mar 28, 2015 6:01 pm

How can one impllement the idea of scoring in simple words?

Lets say that each player has:
Bob - 5 points in 10 seconds
Mike - 10 points in 5 seconds
John - 15 points in 15 seconds

how they can be arranged according to score numbers? And then adressed by name - for further sortings ?
First I thought of putting them into array, sorting and retrivieng back by iid .

Manual says:

Sorts the order of elements on an axis in ascending order. Note that in multidimensional arrays this sorts based on the first element on the axis. For example sorting the X axis in a 2D array will sort the order of the columns based on the elements at Y co-ordinate 0, while preserving the contents of each column.


Does it mean that after first sorting they do not preserve corresponding times ?

thanks for help

p.s
I have seen the tut called "Asteroid clone in less than 100 events" that includes scoring, but sorry, no capx to strip what I wanted out of it.
B
10
S
3
Posts: 25
Reputation: 709

Post » Sat Mar 28, 2015 11:07 pm

It sounds like the rows get sorted by the first element, so the y=0 element. I don't think sorting will mess up scores etc, as long as each player is on their own x, and y=0 is score, y=1 is the name, y=2 is always the time, y=3 is whatever else. As long as you sort by X axis, Score will be in order, and each score will still be in the same row as the player name and time.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Fri Apr 03, 2015 5:41 pm

Funny enough, clicking on "reverse x, y, z" button produces unexpected results for me, and finally gets zeroes.
Width - 3, height - 4, depth - 4.
capx file
dropbox.com/s/swcpnsi8n13dw59/array2.capx?dl=0
initial table
dropbox.com/s/uoj8au7vl08u5h0/Screenshot%20-%2003.04.2015%20%2C%2021_39_38.png?dl=0
B
10
S
3
Posts: 25
Reputation: 709


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 5 guests