This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
1.1.0
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