jordi82's Recent Forum Activity

  • I have populated an array with the team names and scores, and I am using events to sort the array from highest to lowest score, switching to the second column. However, I'm facing two issues:

    - "Team1" does not appear: Despite setting the team names and scores correctly in the array, Team1 is not showing up in the final output. Instead, I see "Team2" and "Team3" with their correct scores, but "Team1" is missing (I got "NaN").

    - Text Appears in Bold: The text displayed for the leaderboard seems to be in bold, even though it shouldn't be. I haven't set any special formatting for the text, so I'm not sure why this is happening.

    Here's a snippet of my events:

  • Thank you for your suggestion! However, in most sports leaderboards, it's uncommon to see the points listed before the team names.

    I understand that sorting by points as the first column might simplify things technically, but I’m trying to maintain the traditional layout where team names appear first. If you have any ideas on how to achieve that, I’d greatly appreciate it!

    Thanks again for your input! 😊

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey everyone,

    I'm working on a leaderboard in Construct 3 where I store team names and their scores in an array. I’ve already managed to correctly insert the data into the array and display it in a list, but now I’m trying to sort the leaderboard so the team with the highest score appears at the top.

    I’m using a comparison-based sorting algorithm to swap the values in the array, but I’m running into some issues. I’ve set up a loop to compare the values and swap them, but I can’t seem to get it to work properly. Here are the issues I’m facing:

    The leaderboard isn’t being sorted correctly. Some values are duplicated, and the team with the highest score isn’t appearing at the top.

    I’m using a nested loop to compare and swap the values, but I can’t get it to work without duplicating or showing the wrong results.

    I’ve attached an image of my current code. If anyone has any advice on how I can improve this sorting process or what I might be doing wrong, I’d really appreciate it!

    My code:

    What I got:

jordi82's avatar

jordi82

Member since 10 Dec, 2024

None one is following jordi82 yet!

Trophy Case

  • RTFM Read the fabulous manual
  • Email Verified

Progress

2/44
How to earn trophies