This commit is contained in:
Dragon Fire
2021-01-24 21:38:35 -05:00
parent fe49088343
commit c047e57713
+3 -3
View File
@@ -205,7 +205,7 @@ module.exports = class CarRaceCommand extends Command {
const winner = userCarSpaces > oppoCarSpaces ? msg.author : opponent;
const winnerCar = winner.id === msg.author.id ? car : car2;
return msg.say(`Congrats, ${winner}!`, {
files: [path.join(__dirname, '..', '..', 'assets', 'json', 'car-race', 'cars', `${winnerCar}.png`)]
files: [path.join(__dirname, '..', '..', 'assets', 'images', 'car-race', 'cars', `${winnerCar}.png`)]
});
} catch (err) {
this.client.games.delete(msg.channel.id);
@@ -217,9 +217,9 @@ module.exports = class CarRaceCommand extends Command {
const canvas = createCanvas(bg.width, bg.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(bg, 0, 0);
const oppoCarX = -155 + (92 * oppoCarSpaces);
const oppoCarX = -155 + (46 * oppoCarSpaces);
ctx.drawImage(oppoCar, oppoCarX, 208);
const userCarX = -155 + (92 * userCarSpaces);
const userCarX = -155 + (46 * userCarSpaces);
ctx.drawImage(userCar, userCarX, 254);
return canvas.toBuffer();
}