Master Game Community

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Master Game Community

Master Game Productions (MGP) presents Master Game Community (MGC). A forum for all your Game Maker needs.


2 posters

    Dynamic Spreading Puddles

    Nocturne
    Nocturne
    Nocturne Games


    Posts : 17
    Reputation : 2
    Join date : 2010-09-16
    Age : 50
    Location : Spain

    Dynamic Spreading Puddles Empty Dynamic Spreading Puddles

    Post by Nocturne Mon Oct 04, 2010 1:55 am

    Dynamic Spreading Puddles
    A surface effect to create spreading puddles that are permanent

    Compatibility: GM7(pro) / GM8(pro)
    Tutorial Type: Example
    Downloadable Content: GM7/GM8(pro)
    Skill Level: Intermediate
    Objective: Use a surface to achieve a permanent fps friendly effect
    Category: Eye Candy

    For a project of mine I needed a way to make ice melt from a top down perspective, so I tried it with sprites and alphas and discovered that where two sprites overlapped, the alphas combined and made the effect less than convincing. I decided then to experiment with blend modes and surfaces to see if I could get the sprites to combine in a convincing way... and this small file/tutorial was born!!

    To check out the effect, just run the gmk and press the left mouse button... You will see puddles of blood appear and spread before your eyes! If you want water, or slime, just press the right mouse button to change the colour, and if you want to clear the screen press space. Here´s a screenshot...

    Dynamic Spreading Puddles Screenshot100cg2

    To use in your game, merge the file with the game file and place the "obj_generator" in your rooms. In the "obj_generator" delete all events except the create, room end and draw... Now whenever you need to draw a puddle just use instance_create(x,y,obj_puddle) and that´s it!

    All code is fully commented and contains a couple of alternative lines that are commented out. They are related to quality (I recommend normal for small rooms under 1024 x 1024px and low for larger rooms) and there is an alternate blend mode in the puddle object. The variables for changing size, speed of spread and colour are also indicated for customising the look of the effect.

    If you download this please comment (although I know you wont!) and as usual no credit is necessary but appreciated!!!!
    MasterOfKings
    MasterOfKings
    MGC Master


    Posts : 67
    Reputation : 0
    Join date : 2010-04-01

    Dynamic Spreading Puddles Empty Re: Dynamic Spreading Puddles

    Post by MasterOfKings Wed Oct 06, 2010 2:21 am

    I used this on my previous game (never released), and I'm planning on using it in MGP's Mechanical Warfare. It's really good!

    Some issues would be the puddles don't spread over surface edges (if you wanted multiple surfaces). I found a fix for this by having object's determine the image's location and collision with them, and then draw on all surfaces it sits over (probably not a very efficient way). Other than that, not a single bug!

    Really good thing to have! Thanks Mark!

    -MoK

      Current date/time is Fri Apr 26, 2024 4:46 am