kaplay icon indicating copy to clipboard operation
kaplay copied to clipboard

feat: Improved hitboxes and collisions

Open sharmnten opened this issue 1 year ago • 3 comments

The problem I'm always frustrated when in my game, the hit-boxes of various game objects are slightly to large, resulting in the player being able to float off corners.

The solution I would like Improved hit boxes and collision recognition in kaplay.

Additional context image

sharmnten avatar May 31 '24 16:05 sharmnten

can you enable debug to show the hitboxes (F1 key or debug.inspect = true)

niceEli avatar May 31 '24 19:05 niceEli

image

sharmnten avatar May 31 '24 19:05 sharmnten

this happens because of the bounding box for the hitbox being the size of the sprite

if you would like to customize it then you can change the size using the the area component API https://kaplayjs.com/reference/#area

niceEli avatar Jun 01 '24 15:06 niceEli

Circle areas were added on v4000

lajbel avatar Nov 28 '24 23:11 lajbel