Anyone need help with small projects?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

Re: Anyone need help with small projects?

Post 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
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

Re: Anyone need help with small projects?

Post 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
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: Anyone need help with small projects?

Post 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.
Attachments
lerp.love
Use love 0.10.1 plis
(551 Bytes) Downloaded 68 times
Last edited by Sulunia on Fri Apr 08, 2016 9:34 pm, edited 1 time in total.
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

Re: Anyone need help with small projects?

Post 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.
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: Anyone need help with small projects?

Post 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:
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

Re: Anyone need help with small projects?

Post 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)
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Anyone need help with small projects?

Post 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.)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
pgimeno
Party member
Posts: 3655
Joined: Sun Oct 18, 2015 2:58 pm

Re: Anyone need help with small projects?

Post 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.
User avatar
Sulunia
Party member
Posts: 203
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: Anyone need help with small projects?

Post 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:
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia
User avatar
Vimm
Party member
Posts: 113
Joined: Wed Mar 16, 2016 8:14 pm

Re: Anyone need help with small projects?

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests