https://kotlinlang.org logo
#korge
Title
# korge
l

Lazard

12/21/2020, 10:50 AM
Hi, is there a way to trigger on a collision exit rather than on a collision enter (sprite.onCollision) ? I can use hitTest inside an updater to do it manually but I cannot use shapes with this method. (I want to detect when a player is falling down a platform for example.) Thanks for you help 🙏
m

Mayank

12/21/2020, 11:03 AM
Hi @Lazard I couldn't find such method but you can create your own extension function similar to onCollision (which is itself an extension function) https://github.com/korlibs/korge/blob/a20ce6dfd7fd71088c56ce6db9ee987ea5e57683/kor[…]ge/src/commonMain/kotlin/com/soywiz/korge/view/ViewCollision.kt
d

Deactivated User

12/21/2020, 11:28 AM
And if you find it useful and reusable, please, feel free to make a PR adding it! :)
👍 2
l

Lazard

12/21/2020, 11:31 AM
Thank you ! I'll try it and maybe make a PR you're right 😉
👏 2
https://github.com/korlibs/korge/pull/312 It's my first ever open source PR, I hope I did it correctly 😊
🙏 1
👏 1
4 Views