This commit is contained in:
lilyissillyyy
2026-02-17 16:34:01 -05:00
parent 03fd813543
commit 1614f65832
+8 -8
View File
@@ -381,15 +381,15 @@ module.exports = class CarRaceCommand extends Command {
const oppoCarX = oppoData.spaces < 7 ? -155 + (77 * oppoData.spaces) : bg.width - 155; const oppoCarX = oppoData.spaces < 7 ? -155 + (77 * oppoData.spaces) : bg.width - 155;
if (turnWin && oppoData.spaces > 0) { if (turnWin && oppoData.spaces > 0) {
motionBlur(ctx, oppoData.car, oppoCarX, 208, oppoData.car.width, oppoData.car.height); motionBlur(ctx, oppoData.car, oppoCarX, 208, oppoData.car.width, oppoData.car.height);
if (oppoData.trail && oppoCarX > oppoData.car.width) { if (oppoData.trail && 0) {
for (let x = oppoCarX - oppoData.trail.width; x + oppoData.trail.width > 0; x -= oppoData.trail.width) { for (let x = oppoCarX - oppoData.trail.width; x > -oppoData.trail.width; x -= oppoData.trail.width) {
motionBlur(ctx, oppoData.trail, x, 208, oppoData.trail.width, oppoData.trail.height); motionBlur(ctx, oppoData.trail, x, 208, oppoData.trail.width, oppoData.trail.height);
} }
} }
} else { } else {
ctx.drawImage(oppoData.car, oppoCarX, 208); ctx.drawImage(oppoData.car, oppoCarX, 208);
if (oppoData.trail && oppoCarX > oppoData.car.width) { if (oppoData.trail && oppoCarX > 0) {
for (let x = oppoCarX - oppoData.trail.width; x + oppoData.trail.width > 0; x -= oppoData.trail.width) { for (let x = oppoCarX - oppoData.trail.width; x > -oppoData.trail.width; x -= oppoData.trail.width) {
ctx.drawImage(oppoData.trail, x, 208); ctx.drawImage(oppoData.trail, x, 208);
} }
} }
@@ -397,15 +397,15 @@ module.exports = class CarRaceCommand extends Command {
const userCarX = userData.spaces < 7 ? -155 + (77 * userData.spaces) : bg.width - 155; const userCarX = userData.spaces < 7 ? -155 + (77 * userData.spaces) : bg.width - 155;
if (turnWin && userData.spaces > 0) { if (turnWin && userData.spaces > 0) {
motionBlur(ctx, userData.car, userCarX, 254, userData.car.width, userData.car.height); motionBlur(ctx, userData.car, userCarX, 254, userData.car.width, userData.car.height);
if (userData.trail && userCarX > userData.car.width) { if (userData.trail && userCarX > 0) {
for (let x = userCarX - userData.trail.width; x + userData.trail.width > 0; x -= userData.trail.width) { for (let x = userCarX - userData.trail.width; x > -userData.trail.width; x -= userData.trail.width) {
motionBlur(ctx, userData.trail, x, 254, userData.trail.width, userData.trail.height); motionBlur(ctx, userData.trail, x, 254, userData.trail.width, userData.trail.height);
} }
} }
} else { } else {
ctx.drawImage(userData.car, userCarX, 254); ctx.drawImage(userData.car, userCarX, 254);
if (userData.trail && userCarX > userData.car.width) { if (userData.trail && userCarX > 0) {
for (let x = userCarX - userData.trail.width; x + userData.trail.width > 0; x -= userData.trail.width) { for (let x = userCarX - userData.trail.width; x > -userData.trail.width; x -= userData.trail.width) {
ctx.drawImage(userData.trail, x, 208); ctx.drawImage(userData.trail, x, 208);
} }
} }