Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

1.1.0

Compare
Choose a tag to compare
@shysolocup shysolocup released this 12 Sep 18:28
· 14 commits to main since this release
14b234f

Updated class builder to allow for more modding with the new PangineClass.Class()

var { game } = wc.pangine.Instances;


new game.Lobby.Class("Leaderboard", class {
    constructor(func) {
        let lobby = this.parent;

        if (!func) func = function(a, b) {
            return b.score - a.score;
        }

        return lobby.players.sort(func);
    }
});


let lobby = new game.Lobby(ctx, {
    starterPlayerValues: {
        score: 0
    }
});


console.log(new lobby.Leaderboard()); // returns a greatest to least leaderboard of all the players