Page 2 of 2

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 4:03 pm
by Vimm
Sulunia wrote:Instead of directly defining certain values, such as the Y position of the blocks in the blockbreaker example, you instead use a math function to set this value indirectly.

Code: Select all

BlockY = 30
would be

Code: Select all

BlockY = 0 --define this in the load
BlockY = lerp(BlockY, 30, 0.05 ) -- make sure you run this inside the update
In this case, instead of simply appearing at the Y = 30 position, the block would slide down until it's Y was equal to 30.
I tried doing that and didnt get it to work, never even heard of "lerp" lol

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 4:03 pm
by Vimm
HaftSwimmingly wrote:
Vimm wrote:
Sulunia wrote:
I think he's the one who mentioned on some other thread his video card is glitchy, and stuff simply doesn't run well.
Yeah I'm that guy...
May I ask what graphics card you have?
AMD Radeon R9 270x

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 4:29 pm
by Sulunia
Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
More information about "lerp" can be found here: (https://en.wikipedia.org/wiki/Linear_interpolation).

The example attached features a very simple utilisation of such effect.

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 4:50 pm
by Vimm
Sulunia wrote:
Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).

The example attached features a very simple utilisation of such effect.

totally didn't spend like 15 minutes pretending the square was chasing me... :D

also, thanks for the example, I think I get it now, didn't know I had to make the function, I thought it was an implemented function haha.

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 4:59 pm
by Sulunia
Vimm wrote:
Sulunia wrote:
Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).

The example attached features a very simple utilisation of such effect.

totally didn't spend like 15 minutes pretending the square was chasing me... :D

also, thanks for the example, I think I get it now, didn't know I had to make the function, I thought it was an implemented function haha.
I suggest you watch the video i linked in my first answer. It shows you how to make good usage of such effects to improve overall game looks even with the simplest graphics. :nyu:

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 5:10 pm
by Vimm
Sulunia wrote:
Vimm wrote:
Sulunia wrote:
"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).

The example attached features a very simple utilisation of such effect.

totally didn't spend like 15 minutes pretending the square was chasing me... :D

also, thanks for the example, I think I get it now, didn't know I had to make the function, I thought it was an implemented function haha.
I suggest you watch the video i linked in my first answer. It shows you how to make good usage of such effects to improve overall game looks even with the simplest graphics. :nyu:

yeah i watched it when you posted it, my goal rn is to get a ball to fall from the top to the bottom, go past the bottom then bounce back up like in the video (shown at roughly 4:50)

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 6:09 pm
by zorg
Sulunia wrote:
zorg wrote:Something about windowless löve...
Actually, i had an idea after watching "the matrix" again. I thought about using love2d to create a "matrix console", which would get information from a lot of different websites and spit it out on the console in realtime.
Quite useless, yes, but i would use threads to gather data and also would improve parsing skills/JSON, aswell as providing me with a nice "screensaver". :D

Currently i won't pull it off since i got my hands full with BeatFever though.
If you ever will, then do tell me, and please make it modular/easily programmable to get information via different APIs per-site, since it'd help people's (or at least my) productivity if such a thing existed :3 (no more forgotten updates from people, direct feeds combined into one app, even for sites not having feeds per-se.)

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 9:07 pm
by pgimeno
Sulunia wrote:
Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).

The example attached features a very simple utilisation of such effect.
Well, to be precise, that one is not linear. Linear would have constant velocity, not go slower when it's near the destination. That one is exponential, actually.

To have linear interpolation you need to put both the origin and the destination points in the function call, and iterate using a parameter 't' to make it go from 0 to 1 in constant steps, and both origin and destination would always stay the same during the process, without feeding the output back as an input. It returns a point between origin and destination proportionally to 't'. For example, when t = 0.5 it returns the midpoint.

I know, it's duller :) But by playing with blending functions (i.e. by changing t in between) you can actually get interesting results that are no longer linear. Rebound effects, acceleration/deceleration at ends, and so on.

Re: Anyone need help with small projects?

Posted: Fri Apr 08, 2016 9:31 pm
by Sulunia
pgimeno wrote:
Sulunia wrote:
Vimm wrote: I tried doing that and didnt get it to work, never even heard of "lerp" lol
"Lerp" stands for "Linear Interpolation". (https://en.wikipedia.org/wiki/Linear_interpolation).

The example attached features a very simple utilisation of such effect.
Well, to be precise, that one is not linear. Linear would have constant velocity, not go slower when it's near the destination. That one is exponential, actually.

To have linear interpolation you need to put both the origin and the destination points in the function call, and iterate using a parameter 't' to make it go from 0 to 1 in constant steps, and both origin and destination would always stay the same during the process, without feeding the output back as an input. It returns a point between origin and destination proportionally to 't'. For example, when t = 0.5 it returns the midpoint.

I know, it's duller :) But by playing with blending functions (i.e. by changing t in between) you can actually get interesting results that are no longer linear. Rebound effects, acceleration/deceleration at ends, and so on.
I see. I'll fix my post then! :megagrin:

Re: Anyone need help with small projects?

Posted: Fri Apr 22, 2016 8:23 pm
by Vimm
kikito wrote:Notice that you don't necessarily need graphics to make cool stuff. You could, for example, investigate sound synthesis - maybe doing synth music. I remember seeing some threads about it some time ago. It's a road few people take, because there's some math and sound is less "flashy" than graphics. But it might suit you.
I tried looking into that, but I think most references about how to do it are outdated, whenever I follow tutorials and the such on sound synthesis I just get errors, even when i copy and paste the code to be sure.