LÖVE is a game framework which allows you to make your own 2D games with Lua. Your game can easily be played by anyone with LÖVE installed on their Windows, Mac or Linux computer.
It has support for many image and audio formats, physics, networking, particle effects, and also has some user-made libraries (downloaded separately) to make developing games even easier.

Useful links:
Forum
Wiki (also hosts documentation)
Bug tracker
IRC Channel (#love@freenode.net)

Image RSS Feed Latest Screens
Lövely Mario Bros - Tech Demo 02 LÖVE Particle System LÖVE Error Handling
Blog RSS Feed Report abuse Latest News: Simulating dynamic weather effects (rain)

About Autumn Game with 0 comments by nunodonato on May 27th, 2014

But first, the video: (somethings have already changed since this recording was made, but anyway…)

So the whole thing is quite simple, actually. But let’s go step by step.

The first thing is to decide when the rain starts and ends, its duration and intensity. So I have a function that makes these decisions, that is called on the start of the game, and every time the rain finishes. In Autumn, the game time follows a year cycle, mapped from 0 to 100. So the beginning of winter is 0, and the end of autumn is 100, then the whole thing repeats in cycles.

So I can assign the rain to start and end at specific times. To do that, I have a few important variables:

  • rain_start_time
  • rain_end_time
  • rain_climax_time
  • rain_climax_strength
  • rainctl

The first two should be self-evident. The climax time defines when the rain intensity should reach the climax_strength (ranges from 0.3 to 1). Having this four variables allows me to create more realistic rain effects, as they will be different every time.

The last one, rainctl, is the main variable, that holds how much rain there is at any given moment (ranges from 0 to 1). Its value is normalized according to the current game time position relatively to the rain start, end and climax times and the climax strength

So, for example, I can have rain that has the climax_time very close to the start_time, which will make it start very fast and then slowly wane away.  The graphic below shows two different scenarios, that illustrate this

rain-graph

Now we have to put all this into something the player can see (and hear!). The value of rainctl directly affects three different aspects of the rain:

  • amount of droplets on the screen glass
  • amount of rain (lines)
  • volume of the rain sound

Having just one variable (rainctl), makes things really easy!

The droplets on the screen are very simple “objects” that have a few properties which make them feel a bit more real:

  • size (random)
  • falling speed (random, depends on size)
  • initial color alpha

On every update call, I reduce the alpha of each drop, until it becomes 0 and gets removed. The rainctl value indicates the maximum number of drops that can be on the screen. The falling speed depends on the size so that bigger drops seem to fall faster and smaller ones.

The rain lines are just randomly drawn grey semi-transparent lines. I also use the rainctl value to set up a maximum number of lines that get drawn.

And finally, the volume of the rain sound is directly set by rainctl, as it also ranges from 0 to 1.

So there it is, quite simple! It took me a whole day to do it, because I had to come up with the idea, try different ways of doing it and finally settling down with this one and tuning it up.

Besides this I also do a bunch of sanity checks that are more closely related with Autumn (like, few chance of rains in summer, or only light showers, etc).

See you soon!

Games
10 Second War

10 Second War 10 Second War Indie

Updated 3 years ago Released Mar 23, 2010 Single Player Real Time Strategy

This is a real time strategy, action, top down shooter. You control a small army over the course of 10 seconds. You control a unit for 10 seconds, as...

400X

400X 400X Indie

Updated 1 year ago TBD Single Player Arcade

You are a specialist assigned to seek and destroy alien parasites that embed themselves in the bodies of our galactic explorers. The nanobots are microscopic...

9891

9891 9891 Indie

Updated 3 weeks ago Released Dec 1, 2013 Single & Multiplayer Arcade

The USSR is about to collapse, and a deadly virus has been released. You've been sent by the government to help fight this virus and bring peace back...

Alfred: The Alien Inside

Alfred: The Alien Inside Alfred: The Alien Inside Indie

Updated 1 year ago TBD Single Player Platformer

Alfred: The Alien Inside is a 2D platform game developed using Lua and LOVE how engine. The game is still in development and I can say is that Alfred...

And Then There Was One

And Then There Was One And Then There Was One Indie

Updated 10 months ago Released Sep 1, 2013 Single & Multiplayer Stealth

And Then There Was One is a four player stealth game in which players assassinate targets or other assassins within a crowd. To avoid death either blend...

Post comment Comments  (10 - 18 of 18)
Chivvy
Chivvy Mar 24 2010, 12:12pm says:

Can some body help me I cant get it started it just is that tank

+2 votes     reply to comment
moci
moci Apr 8 2010, 7:50pm replied:

You have to drag the .love files in the love executable.

.love files describe the "game"
love.exe is the actual engine.

You load your game by opening it with the love.exe.

+2 votes     reply to comment
DELTΔ
DELTΔ Mar 3 2010, 9:18pm says:

Trust me its great its just quite hard to learn.

+2 votes     reply to comment
ItsThatMatt
ItsThatMatt Dec 9 2009, 7:53pm says:

I'm thinking about trying this engine out! It looks quite good,

+4 votes     reply to comment
Dna|tmrocks
Dna|tmrocks Mar 23 2009, 2:06am says:

What was used to make the Space Background/Stars?

+2 votes     reply to comment
hardcoregamer24
hardcoregamer24 Feb 27 2011, 8:15am replied:

you could use textures or make particles of your own to give it that spiced feeling.

+2 votes     reply to comment
krg
krg Mar 13 2009, 7:58pm says:

I like the header image. Very cool. Cant really tell what it has to do with this game though.

+1 vote     reply to comment
daleluck1313
daleluck1313 Mar 17 2009, 6:50pm replied:

Love is an engine, not a game. The screen(s) are from games made using this engine.

+3 votes     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Platforms
Windows, Mac, Linux
Contact
Send Message
Official Page
Love2d.org
Licence
Zlib
Release Date
Released Jan 13, 2008
Engine Watch
Track this engine
Share
Community Rating

Average

9.5

46 votes submitted.

You Say

-

Ratings closed.

Highest Rated (2 agree) 10/10

There is no easier and friendlier way to get started with game programming out there!

Dec 9 2010, 12:38pm by qubodup

Twitter

Latest tweets from

It can take up to a few hours for tweets to begin appearing.

Embed Buttons

Promote LÖVE on your homepage or blog by selecting a button and using the HTML code provided (more).

LÖVE LÖVE
LÖVE
Statistics
Rank
32 of 639
Last Update
1 week ago
Watchers
121 members
Games
84
Files
21
News
85
Features
3
Tutorials
2
Reviews
8