This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
Cannot Use Custom Shapes #846
Answered
by
lajbel
ahmutkadim
asked this question in
Q&A
-
Hi, I am very new to Kaboom.js and have problem with adding custom shape to an area component. Here is the code snippet for object creation: let player = k.add([
k.sprite("player"),
k.area({shape: k.rect(20, 30)}),
k.pos(320, 180),
k.body({jumpForce: 300}),
]); The error it gives: "Only support polygon and rect shapes for now" Am I doing something wrong or is this a bug? |
Beta Was this translation helpful? Give feedback.
Answered by
lajbel
Apr 9, 2024
Replies: 1 comment
-
no documented, sorry. You should use k.area({
shape: new k.Rect(k.pos(0), 20, 30),
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lajbel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
no documented, sorry.
You should use