mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 22:32:50 +02:00
Fix
This commit is contained in:
@@ -356,9 +356,9 @@ module.exports = class CarRaceCommand extends Command {
|
|||||||
const canvas = createCanvas(bg.width, bg.height);
|
const canvas = createCanvas(bg.width, bg.height);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.drawImage(bg, 0, 0);
|
ctx.drawImage(bg, 0, 0);
|
||||||
const oppoCarX = -155 + (77 * oppoCarSpaces);
|
const oppoCarX = oppoCarSpaces <= 7 ? -155 + (77 * oppoCarSpaces) : bg.width + 155;
|
||||||
ctx.drawImage(oppoCar, oppoCarX, 208);
|
ctx.drawImage(oppoCar, oppoCarX, 208);
|
||||||
const userCarX = -155 + (77 * userCarSpaces);
|
const userCarX = userCarSpaces <= 7 ? -155 + (77 * userCarSpaces) : bg.width + 155;
|
||||||
ctx.drawImage(userCar, userCarX, 254);
|
ctx.drawImage(userCar, userCarX, 254);
|
||||||
if (win) {
|
if (win) {
|
||||||
const fireworks = await loadImage(
|
const fireworks = await loadImage(
|
||||||
|
|||||||
Reference in New Issue
Block a user