kaplayjs does not provide an export named 'Vec2' #828
-
|
I don't know if this is a bug or my writing problem. import { Vec2, type Comp, type KAPLAYCtx } from 'kaplay'
export type WorldPlaceData = {
name: string
pos: Vec2
stuffData: { id: string; rate: number; maxNum: number }[]
}
export interface WorldPlaceComp extends Comp {
data: WorldPlaceData
}
export function createWorldPlaceObj(data: WorldPlaceData) {
return (k: KAPLAYCtx) => {
return k.add([createWorldPlaceComp(data), k.pos()])
}
}
export function createWorldPlaceComp(data: WorldPlaceData): WorldPlaceComp {
return {
id: 'worldPlace',
data,
}
}I’d be grateful if you could assist me. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I believe |
Beta Was this translation helpful? Give feedback.
-
|
You can't import it like that. Just import // anywhere you have this
export const k = kaplay();// in your custom comp file
import { k } from "./file.js"Then use |
Beta Was this translation helpful? Give feedback.
You can't import it like that. Just import
Then use
k.Vec2