fix(game): forgot to add menu

pull/37/head
Alex 2024-03-02 15:21:27 +01:00
parent 9f61b3e53c
commit ba5be77ae5
3 changed files with 4 additions and 2 deletions

View File

@ -32,6 +32,7 @@ export function Dust({ count = 500, opacity = 0.1, size = 0.6 }) {
let time = 0
let i = 0
useFrame((state,delta ) => {
if(!leftWheel && !rightWheel) return;
const rotation = leftWheel.kartRotation;
if (state.clock.getElapsedTime() - time > 0.02 && leftWheel && rightWheel && ref.current && leftWheel.isSpinning) {
time = state.clock.getElapsedTime()

View File

@ -19,6 +19,7 @@ export function Skid({ count = 50000, opacity = 0.5, size = 0.3 }) {
const { leftWheel, rightWheel } = useStore();
let index = 0
useFrame(() => {
if(!leftWheel && !rightWheel) return;
const rotation = leftWheel.kartRotation;
if (leftWheel && rightWheel && ref.current && (leftWheel.isSpinning || rightWheel.isSpinning)) {
setItemAt(ref.current, rotation, leftWheel, index++);

View File

@ -13,8 +13,8 @@ export const items = [
]
export const useStore = create((set, get) => ({
gameStarted: true,
controls: "gamepad",
gameStarted: false,
controls: "",
particles1: [],
particles2: [],
leftWheel: null,