Think I've done it. I just increased the Array Width and Height Properties! Problem solved!
Thank you for your efforts to help me!
I'm sorry I don't know how or where to incorporate this in the construct event sheet :(
If you need it, here is a link to my construct file:
drive.google.com/file/d/1q_3-V3-i_f7dQfSqgcylfsk2LBgs2ceF/view
So in getscores.php I have changed it to this so I get 12 lines of results??:
// Retrieve data from database
$sql = "SELECT *
FROM scores
ORDER BY score
LIMIT 24"; // The 'LIMIT 24' part will only read 24 scores. Feel free to change this value
$result = mysqli_query($con, $sql);
I currently have 10 scores in my database but my leaderboard is still only showing 5 scores. Is there anything else I need to change in php files or in Construct to adjust the array size?
Thank you for looking into this for me. It has nothing to do with the initial values being 0 does it? and since 0 is a faster 'time' than other results in my database that it is showing these instead? Although the 0s are not being ordered at the top of the leaderboard so I'm guessing that isn't what's happening. The returned rank IS taking into account all the database records so I still haven't a clue.
Thank you for replying! Rank was still out using the advice above but fixed it another way (I hope).
I've definitely got more than 5 scores in the database. It's updating the leaderboard order OK when I submit a new result but still nothing after row 5 (just 0 0). Have tried twice to delete and re-add text boxes (do I need to set/add anything else in the layout? It is hard to tell from your example file - there are lots of additional textScore & textNames but assume that is just for your version? Couldn't see that they were referenced anywhere within the project). Is there anything else you can think of that might be affecting it and need changing? It's so odd.
Hi
Thank you so much for this tutorial. I've managed to get everything working except for 2 issues:
1: My leaderboard is only showing the top 5 results (the other 4 lines on screen are just showing the default 0 0.
2: When I sort the results into ASC order (as I want to show the fastest time as the best score) the rank is always wrong by 1. I played the game for the first time and submitted my score and my rank came up as 2. This continues to be wrong with each new entry. I've checked my database and there are the correct number of entries. Am I doing something wrong? How can I amend it so it is correct?
Can you help? I'd be so grateful!
Member since 7 Nov, 2020