korlibs / korlibs/korge

Make onCollision events and its cousins return more info about the collision event.

Open
#410 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
3k
Forks
148
Avg merge
13h 44m
Merged PRs (30d)
1

Description

Currently, `onCollision` and `onCollisionExit` only return the view object in the callback.

I wish that it would also return the collision information, such as where the collision point was (on the right of the view? on the left?).

Without this info, it's difficult to take meaningful action on the event. Take for example, we implement a ball bouncing around a box like Pong. On the balls collision with the walls, without collision info, it's cumbersome to resolve which side the ball was hit on, and therefore, which way the ball should reflect (e.g. along x axis? along y axis?)

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the onCollision and onCollisionExit callback definitions and their cousins. Inspect how collision information is represented, then define what data callbacks should expose so callers can identify the collision point or side; done means the callbacks provide that information consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.