Simulating rainfall
One thing I enjoy is when a game developer adds some small touches to increase the player's immersion in the game's world. How can you go about doing this? Why not add some real-world elements to start with? Let's try making it rain. By this, I mean simulating drops of water falling from the sky, not tossing dollar bills in slow motion; though this would also be cool.
Getting ready
The following recipe is incredibly easy and illustrates another way in which you can use GameMaker's built-in simple particle effects. We're going to continue from the scene that we created in the previous recipe, and we only need to add one thing: a rainmaker object called obj_rain
. Seems simple enough, right? Let's take a look at how it can work.
How to do it...
In
obj_rain
, add a Step event.Drag a code block to the Actions box and add the following code:
effect_create_above(ef_rain, 0, 0, 0, c_white);
Place an instance of
obj_rain
anywhere in the room.
That's it! Once these steps have been completed...