Search found 3 matches
- Tue Nov 24, 2020 11:57 am
- Forum: Support and Development
- Topic: I need help with making a collision resolver
- Replies: 2
- Views: 3255
Re: I need help with making a collision resolver
The intersection of two rectangles is a rectangle that can be calculated this way: local function intersection(r1, r2) local x1 = math.max(r1.x1, r2.x1) local y1 = math.max(r1.y1, r2.y1) local x2 = math.min(r1.x2, r2.x2) local y2 = math.min(r1.y2, r2.y2) if x1 >= x2 or y1 >= y2 then return false --...
- Tue Nov 24, 2020 11:24 am
- Forum: Support and Development
- Topic: Get the sample rate of the default playback audio device
- Replies: 7
- Views: 6678
Re: Get the sample rate of the default playback audio device
Depends on the OS, I think you can find audio device sample rate in the Windows Registry For me (Win10 x64) it is: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render The subfolders are named after all the audio device GUID, the active one will have a DeviceState 0x00...
- Mon Nov 23, 2020 3:16 pm
- Forum: Support and Development
- Topic: I need help with making a collision resolver
- Replies: 2
- Views: 3255
I need help with making a collision resolver
Hey! I am new to LOVE and just started making a 2D platformer game. I have already successfully written a function to determine whether two game objects are colliding: function collision(obj1,obj2) return (obj1.pos - obj2.pos):magnitude() < ((obj1.size*0.5)+(obj2.size*0.5)):magnitude() end function ...