Add vs at start

This commit is contained in:
Dragon Fire
2021-01-29 18:03:50 -05:00
parent 50ce350989
commit 72e041949f
2 changed files with 16 additions and 4 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+16 -4
View File
@@ -39,6 +39,12 @@ module.exports = class CarRaceCommand extends Command {
reason: 'Fireworks Image',
reasonURL: 'https://co.currituck.nc.us/fireworks/'
},
{
name: 'Max Pixel',
url: 'https://www.maxpixel.net/',
reason: 'Stars Image',
reasonURL: 'https://www.maxpixel.net/Stars-Confetti-Curly-String-Balloons-Watercolor-5403247'
},
{
name: 'PNGkit',
url: 'https://www.pngkit.com/',
@@ -402,10 +408,8 @@ module.exports = class CarRaceCommand extends Command {
const x = (bg.width / 2) - 50;
ctx.fillRect(x - 5, 85, 110, 110);
ctx.drawImage(win.id === userData.user.id ? userData.avatar : oppoData.avatar, x, 90, 100, 100);
} else {
const stars = await loadImage(
path.join(__dirname, '..', '..', 'assets', 'images', 'car-race', 'stars.png')
);
} else if (turnWin) {
const stars = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'car-race', 'stars.png'));
ctx.fillStyle = 'black';
ctx.fillRect(105, 45, 135, 135);
ctx.drawImage(userData.avatar, 110, 50, 125, 125);
@@ -421,6 +425,14 @@ module.exports = class CarRaceCommand extends Command {
} else if (turnWin) {
greyscale(ctx, bg.width - 110 - 125, 50, 125, 125);
}
} else {
const vs = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'car-race', 'vs.png'));
ctx.drawImage(vs, (bg.width / 2) - (vs.width / 2), 80, 75, 75);
ctx.fillStyle = 'black';
ctx.fillRect(105, 45, 135, 135);
ctx.drawImage(userData.avatar, 110, 50, 125, 125);
ctx.fillRect(bg.width - 115 - 125, 45, 135, 135);
ctx.drawImage(oppoData.avatar, bg.width - 110 - 125, 50, 125, 125);
}
return canvas.toBuffer();
}