Search found 17 matches
- Wed Jun 07, 2017 2:50 pm
- Forum: Support and Development
- Topic: Smart AI under gravity
- Replies: 4
- Views: 4073
Re: Smart AI under gravity
If a module has a constant acceleration a = (a_x, a_y), with initial speed v = (v_x, v_y), and initial position r_0 = (r_0x, r_0y), then its position at time t is given by r(t) = (r_x(t), r_y(t)) = t^2 * a / 2 + t * v + r_0. (This directly comes from integrating twice the accelaration, taking into a...
- Sun Nov 06, 2016 7:14 pm
- Forum: Support and Development
- Topic: Good hierarchy implementation and practice
- Replies: 3
- Views: 3001
Re: Good hierarchy implementation and practice
Thank you for the answers. At least you don't seem to be against it :) Basically properties of objects are "private" Private properties/functions are a C++ feature that allows you to catch errors during compile-time. In Lua, you would only get a runtime error which you can't recover from. ...
- Sun Nov 06, 2016 9:24 am
- Forum: Support and Development
- Topic: Good hierarchy implementation and practice
- Replies: 3
- Views: 3001
Good hierarchy implementation and practice
Hello there, Probably this topic has been discussed many times, but I could not find a thread about it on the forums here. Hence creating a new one. I'm currently implementing my own gui library, and have decided to use a class system with a full hierarchy of widgets (having started Lua through WoW ...
- Tue Nov 01, 2016 10:18 am
- Forum: General
- Topic: LÖVE 0.10.2 released
- Replies: 42
- Views: 49994
Re: LÖVE 0.10.2 released
You're right, it now shows 0.10.2. Thanksbartbes wrote:You may have to use ctrl+f5, or something similar to clear the cache. I noticed you may need to do the same on the wiki to get the version picker to show 0.10.2.
- Tue Nov 01, 2016 9:27 am
- Forum: General
- Topic: LÖVE 0.10.2 released
- Replies: 42
- Views: 49994
Re: LÖVE 0.10.2 released
First time I witness a LÖVE update, this is beautiful
Sorry for being stupid though, but on the Home page I still see the 0.10.1 version, where can I find the .2 ?
Thanks
Sorry for being stupid though, but on the Home page I still see the 0.10.1 version, where can I find the .2 ?
Thanks
- Mon Oct 31, 2016 9:51 pm
- Forum: Support and Development
- Topic: [Solved] Wildcard index for a table
- Replies: 16
- Views: 7723
Re: Wildcard index for a table
Using the __index metamethod is the right thing to do. Consider the following example: a = { __index = function(tab, key) return a.prototype end, prototype = 'this is the prototype value', } a[1] = 2 a.hello = 'hi' setmetatable(a,a) print(a[2]) print(a[1]) print(a.is_this_defined) print(a.hello) The...
- Wed Oct 26, 2016 9:10 am
- Forum: Support and Development
- Topic: bump.lua bounce
- Replies: 8
- Views: 7050
Re: bump.lua bounce
Just a small remark on your formula to get the angle: you don't really need it. If v = (v_x, v_y) is the speed vector of your ball at the collision, and n = (n_x, n_y) is the normal vector (thus normalized to have norm 1) of the collision, you can get the velocity u = (u_x, u_y) after the collision ...
- Mon Oct 24, 2016 5:42 pm
- Forum: Support and Development
- Topic: Flashlight Effect
- Replies: 17
- Views: 12818
Re: Flashlight Effect
You gonna have to pass current canvas into shader and compute proper texture coordinates and there will be blurring due to interpolation, plus you can't write to the canvas you read from so you'll need to duplicate it first. Whenever something can be easily done without a shader, I prefer that way....
- Mon Oct 24, 2016 10:09 am
- Forum: Support and Development
- Topic: Flashlight Effect
- Replies: 17
- Views: 12818
Re: Flashlight Effect
This post may prove helpful: https://love2d.org/forums/viewtopic.php?p=198669#p198669 Edit: Proof of concept attached. I've reduced the opacity of the mask canvas to let something be seen through. In your post from that other thread, you say You can mimic subtractive mode using a shader, if you abs...
- Thu Oct 13, 2016 5:39 pm
- Forum: Support and Development
- Topic: "Questions that don't deserve their own thread" thread
- Replies: 905
- Views: 453488
Re: "Questions that don't deserve their own thread" thread
The internet network is a complex, limited system and its hurdles are felt by everyone involved. It's not about sticking to specific figures, it's about minimizing bandwidth into oblivion. Just always compress your data, it takes minimum amount of time - especially if you use a compression library ...