diff --git a/commands/games-mp/car-race.js b/commands/games-mp/car-race.js index 6386e8a5..76cd6a84 100644 --- a/commands/games-mp/car-race.js +++ b/commands/games-mp/car-race.js @@ -392,14 +392,14 @@ module.exports = class CarRaceCommand extends Command { const ctx = canvas.getContext('2d'); ctx.drawImage(bg, 0, 0); const oppoCarX = oppoData.spaces < 7 ? -155 + (77 * oppoData.spaces) : bg.width - 155; - if (turnWin && turnWin.id === oppoData.user.id) { + if (turnWin) { motionBlur(ctx, oppoData.car, oppoCarX, 208, oppoData.car.width, oppoData.car.height); } else { ctx.drawImage(oppoData.car, oppoCarX, 208); } const userCarX = userData.spaces < 7 ? -155 + (77 * userData.spaces) : bg.width - 155; - if (turnWin && turnWin.id === userData.user.id) { - motionBlur(ctx, userData.car, userCarX, 208, userData.car.width, userData.car.height); + if (turnWin) { + motionBlur(ctx, userData.car, userCarX, 254, userData.car.width, userData.car.height); } else { ctx.drawImage(userData.car, userCarX, 254); } diff --git a/util/Canvas.js b/util/Canvas.js index 9e1f8566..d68b1701 100644 --- a/util/Canvas.js +++ b/util/Canvas.js @@ -127,8 +127,8 @@ module.exports = class CanvasUtil { static motionBlur(ctx, image, x, y, width, height) { ctx.drawImage(image, x, y, width, height); - ctx.globalAlpha = 0.1; - for (let i = 0; i < 10; ++i) ctx.drawImage(image, x + i, y, width, height); + ctx.globalAlpha = 0.2; + for (let i = 0; i < 10; i += 2) ctx.drawImage(image, x + i, y, width, height); ctx.globalAlpha = 1; return ctx; }