Page 1 of 1

utility and wrapper library

Posted: Fri Apr 04, 2014 12:12 am
by MGinshe
this is my first proper post here, so i'm sorry if i derped anything.

i've made a few non-serious projects with love, and every single time i find myself rewriting the same boring utility and math functions. it's boring, time consuming, and sometimes frustrating. i present to you util.lua! it has a bunch of useful vector/angle functions, table deepcopy/merge/print, a full cron wrapper, a black and whitelistable traceLine function for HardonCollider, and some other useful crap that you've probably done a few times already!

there's no readme yet, but i'll get something up later tonight. the functions are all commented so it shouldn't be too difficult

Features
  • - wrapper for cron.lua by kikito
    - traceLine() and findInRange() for HardonCollider by vrld
    - angle to unit-vector and back
    - angle lerping (with cross-product)
    - requireDir() function
    - canvas drawing function, with (centered) rotation
    - table merging, copying, printing, and sorting
    - centered and/or shadowed text drawing
    - unique id generator
    - asset loading (wip)
    - some misc functions
GitHub / Download util.lua

Re: utility and wrapper library

Posted: Sat Apr 05, 2014 6:06 am
by omnione
hey mGinshe,

At a quick glance, nice library! definitely a lot of things I have used and can use for the game I'm currently working on. However, I was wondering if you know a function to check if two rectangles that are translated/rotated are intersecting? Basically a collision detection between two rotated rectangle. I can't seem to figure it out and any tips would be great! Thanks!

Re: utility and wrapper library

Posted: Sun Apr 06, 2014 3:13 am
by MGinshe
omnione wrote:hey mGinshe,

At a quick glance, nice library! definitely a lot of things I have used and can use for the game I'm currently working on. However, I was wondering if you know a function to check if two rectangles that are translated/rotated are intersecting? Basically a collision detection between two rotated rectangle. I can't seem to figure it out and any tips would be great! Thanks!
i'm using hardoncollider for collisions at the moment, so intersections is kinda low priority right now. i'll try implement a collision test function at some point in the future. until then, this tutorial series is a really good start point. the dudes channel is full of really useful stuff, well worth checking out!