How do I Create A Local High Score Table

Get help using Construct 2

Post » Tue Oct 28, 2014 7:16 pm

Welp, what the title says, ten names, mostly like in old arcade games I guess. Saving to/loading from local storage/file is not urgent but would be cool too!

Tried creating it myself, found it a lil bit tough to be honest so any suggestions are welcome!
B
80
S
23
G
6
Posts: 240
Reputation: 7,761

Post » Tue Oct 28, 2014 8:37 pm

Did you watch this? Which part are you having trouble with?

https://www.scirra.com/tutorials/581/top-10-high-score-with-webstorage-and-arrays
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Oct 29, 2014 11:59 am

Looks great, thanks! Definitely gonna check it out!
B
80
S
23
G
6
Posts: 240
Reputation: 7,761

Post » Mon Nov 03, 2014 10:12 am

Found a new problem - score repeats itself across the whole table. Strange because I did everything like in the tutorial. I saw a user was complaining about this as well (Vertigo's comment on https://www.scirra.com/tutorials/581/to ... ays?page=2), except in my case score repeats on any preview or export.
B
80
S
23
G
6
Posts: 240
Reputation: 7,761

Post » Mon Nov 03, 2014 10:57 am

Can you provide a sample capx?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Nov 03, 2014 2:33 pm

Sure https://dl.dropboxusercontent.com/u/1306951/t1.capx

Be warned though - it's messy! My code is in Event Sheet 1, first 10 events, nevermind the rest of it.
B
80
S
23
G
6
Posts: 240
Reputation: 7,761

Post » Mon Nov 03, 2014 9:42 pm

Had a quick look, don't have much time at the moment but a couple of things might be wrong. When you're parsing the high scores from webstorage, you're parsing for "," but in the webstorage value there are no commas. Also when displaying the high scores you're not picking a particular one, so they will all get set. At least it might be somewhere to look.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests