littlektframework / littlekt

A multiplatform WebGPU 2D game framework written in Kotlin. Build your own game engine on top.
https://littlekt.com
Apache License 2.0
313 stars 12 forks source link

Add more collision functions to Rect() #237

Closed ValleyDragon888 closed 5 months ago

ValleyDragon888 commented 5 months ago

I added some more collision functions to Rect() that I would find useful that handle things like colliding with multiple rectangles in a list, and a function that takes in a Map<T, Rect> and spits out a list of the keys of the rectangles that intersect. I hope that other people will find these useful, and that I haven't screwed up! (This is probably my first real contribution to a repo besides my own)

ValleyDragon888 commented 5 months ago

Thanks! I've learnt a lot about Kotlin today! It's up to you whether you merge this or not.