orm and profile first implementation

This commit is contained in:
Stanislaw
2022-04-20 15:20:22 +02:00
parent 4f11342db8
commit f308503816
14 changed files with 597 additions and 265 deletions

View File

@@ -2,4 +2,22 @@ module.exports = {
lvl: function (exp) {
return Math.floor(Math.sqrt(exp) / 5);
},
expThreshold: function (lvl) {
return Math.floor(lvl * lvl * 25);
},
randomExp: function (min, max) {
return Math.floor(Math.random() * (max - min)) + min;
},
roundRect: function (ctx, x, y, width, height, radius) {
if (width < 2 * radius) radius = width / 2;
if (height < 2 * radius) radius = height / 2;
ctx.beginPath();
ctx.moveTo(x + radius, y);
ctx.arcTo(x + width, y, x + width, y + height, radius);
ctx.arcTo(x + width, y + height, x, y + height, radius);
ctx.arcTo(x, y + height, x, y, radius);
ctx.arcTo(x, y, x + width, y, radius);
ctx.closePath();
return ctx;
},
};