Construct2 example: Local Leaderboard using array
Friend of mine sent me a question how to create a local leaderboard for Top10 scores/times/results/whatever in Construct 2.
I want to introduce one simple way to implement leaderboard locally (no server required). Solution can be seen in this screenshot:
Brief description of the method used:
Basically, this is very simple to do if you understand how to access arrays in C2.
Have fun!
-Jussi.
I want to introduce one simple way to implement leaderboard locally (no server required). Solution can be seen in this screenshot:
Brief description of the method used:
- Save new score to variable for further use (in this case inputScore)
- Check if new score is greater than the lowest value in current array
=> If it is greater, replace lowest value with new score (inputScore) - Sort array contents to descending order using this simple algorithm:
=> Take two consecutive elements from the array, starting from bottom, and compare them
=> If two consecutive elements are not in correct order, swap them
Basically, this is very simple to do if you understand how to access arrays in C2.
Have fun!
-Jussi.
Please help me more. I'm trying to do a leaderboard but i can't see well your screenshot. Can you send me a best image? Thank u (Leopf81@gmail.com)
ReplyDeletePlease help me more. I'm trying to do a leaderboard but i can't see well your screenshot. Can you send me a best image? Thank u (Leopf81@gmail.com)
ReplyDeleteConstruct2 Example: Local Leaderboard Using Array >>>>> Download Now
ReplyDelete>>>>> Download Full
Construct2 Example: Local Leaderboard Using Array >>>>> Download LINK
>>>>> Download Now
Construct2 Example: Local Leaderboard Using Array >>>>> Download Full
>>>>> Download LINK Kh