fix(game): forgot to add menu
parent
9f61b3e53c
commit
ba5be77ae5
|
@ -32,6 +32,7 @@ export function Dust({ count = 500, opacity = 0.1, size = 0.6 }) {
|
||||||
let time = 0
|
let time = 0
|
||||||
let i = 0
|
let i = 0
|
||||||
useFrame((state,delta ) => {
|
useFrame((state,delta ) => {
|
||||||
|
if(!leftWheel && !rightWheel) return;
|
||||||
const rotation = leftWheel.kartRotation;
|
const rotation = leftWheel.kartRotation;
|
||||||
if (state.clock.getElapsedTime() - time > 0.02 && leftWheel && rightWheel && ref.current && leftWheel.isSpinning) {
|
if (state.clock.getElapsedTime() - time > 0.02 && leftWheel && rightWheel && ref.current && leftWheel.isSpinning) {
|
||||||
time = state.clock.getElapsedTime()
|
time = state.clock.getElapsedTime()
|
||||||
|
|
|
@ -19,6 +19,7 @@ export function Skid({ count = 50000, opacity = 0.5, size = 0.3 }) {
|
||||||
const { leftWheel, rightWheel } = useStore();
|
const { leftWheel, rightWheel } = useStore();
|
||||||
let index = 0
|
let index = 0
|
||||||
useFrame(() => {
|
useFrame(() => {
|
||||||
|
if(!leftWheel && !rightWheel) return;
|
||||||
const rotation = leftWheel.kartRotation;
|
const rotation = leftWheel.kartRotation;
|
||||||
if (leftWheel && rightWheel && ref.current && (leftWheel.isSpinning || rightWheel.isSpinning)) {
|
if (leftWheel && rightWheel && ref.current && (leftWheel.isSpinning || rightWheel.isSpinning)) {
|
||||||
setItemAt(ref.current, rotation, leftWheel, index++);
|
setItemAt(ref.current, rotation, leftWheel, index++);
|
||||||
|
|
|
@ -13,8 +13,8 @@ export const items = [
|
||||||
]
|
]
|
||||||
|
|
||||||
export const useStore = create((set, get) => ({
|
export const useStore = create((set, get) => ({
|
||||||
gameStarted: true,
|
gameStarted: false,
|
||||||
controls: "gamepad",
|
controls: "",
|
||||||
particles1: [],
|
particles1: [],
|
||||||
particles2: [],
|
particles2: [],
|
||||||
leftWheel: null,
|
leftWheel: null,
|
||||||
|
|
Loading…
Reference in New Issue