Making rain using Love2d

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.
Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

Making rain using Love2d

Post by Sosolol261 »

I've been working on a project that needs a way to draw rain. I've tried to use particles but the particle system doesn't seem to be made for "rain" particles or i am just bad.

My request: Could you guys tell me ways to simulate rain(without collision and or anything) just a way to draw rain particles? Thank you! :awesome:
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making rain using Love2d

Post by zorg »

You could cheat by using an image (a rain texture) with a mesh; each update, modifying the texture position, so it looks like it's falling; I'll create a demo thing in a jiffy :3
Edit: Attached. Press space to make it REAL intense, and escape exits (if you'd want to test it on android)

Edit2: Uploaded a new version, just to be sure, it checks both keycode and scancode for escape and space, maybe it will work for you now, Bobby :3
Attachments
raintest.love
(278.17 KiB) Downloaded 629 times
Last edited by zorg on Fri Feb 19, 2016 5:22 pm, edited 1 time in total.
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.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Making rain using Love2d

Post by bobbyjones »

Hmm my back key on Android didn't do a thing. I wonder if it's working.
User avatar
nuno
Party member
Posts: 137
Joined: Wed Dec 11, 2013 12:00 pm
Location: Portugal
Contact:

Re: Making rain using Love2d

Post by nuno »

something like this?

Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

Re: Making rain using Love2d

Post by Sosolol261 »

nuno wrote:something like this?
No i mean ingame rain that actually falls down
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making rain using Love2d

Post by zorg »

Sosolol261 wrote:
nuno wrote:something like this?
No i mean ingame rain that actually falls down
I take it my solution won't/didn't work for you then? :3
Last edited by zorg on Sat Feb 20, 2016 11:57 am, edited 1 time in total.
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
nuno
Party member
Posts: 137
Joined: Wed Dec 11, 2013 12:00 pm
Location: Portugal
Contact:

Re: Making rain using Love2d

Post by nuno »

Sosolol261 wrote:
nuno wrote:something like this?
No i mean ingame rain that actually falls down
it does fall down, did you see the video in full screen? low res doesnt show the rain properly (i'm not talking about the rain drops in the screen)
Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

Re: Making rain using Love2d

Post by Sosolol261 »

zorg wrote:
Sosolol261 wrote:
nuno wrote:something like this?
No i mean ingame rain that actually falls down
I take it my solution won't/didn't work for you then? :3
Your solution is really close.. The reason i want to stick to the particles is that I could use a "wind" parameter to adjust the path of a rain drop mid-game and smooth.. does that make sense?
Sosolol261
Party member
Posts: 125
Joined: Wed Nov 26, 2014 6:43 am

Re: Making rain using Love2d

Post by Sosolol261 »

nuno wrote:
Sosolol261 wrote:
nuno wrote:something like this?
No i mean ingame rain that actually falls down
it does fall down, did you see the video in full screen? low res doesnt show the rain properly (i'm not talking about the rain drops in the screen)
Yes something like this would be great
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making rain using Love2d

Post by zorg »

Sosolol261 wrote:
zorg wrote:
Sosolol261 wrote:No i mean ingame rain that actually falls down
I take it my solution won't/didn't work for you then? :3
Your solution is really close.. The reason i want to stick to the particles is that I could use a "wind" parameter to adjust the path of a rain drop mid-game and smooth.. does that make sense?
If you look at my code, you'll see that if you press space, the game draws a second instance of the rain mesh, and it modifies the uv (texture) coordinates in such a way, that it will be acting like the wind is indeed modifying the angle with which it's falling. In your case, the wind parameter could be just the horizontal displacement value, and making that random (smoothed in a way) could definitely work imo.
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.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest