Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Thanks!  

Regarding the win conditions, I would have loved to have put a tutorial in there to make it more obvious but just didn't have the time.  I tried to sort of demonstrate it at the beginning by having that exploding block immediately slide down the slope and move the tall blue block off the pressure plate.  That was my "Oh crap, I have 2 minutes left" attempt at a tutorial.  Haha.

As for the slime, the game is made with GameMaker Studio 2.  There are some built-in soft-body physics that I'm taking advantage of.  In that, I set the slime up with the following flags:

slimeflags = phy_particle_flag_spring | phy_particle_flag_viscous | phy_particle_flag_water;

That combo of flags makes particles that are bouncy, tend to stick together (and a little bit to other things), and flow like water respectively.

When I fire the gun, I make a group of particles like this:

physics_particle_group_begin(slimeflags, phy_particle_group_flag_solid, _x, _y, random(359), lengthdir_x(o_gun.gpower,o_gun.image_angle), lengthdir_y(o_gun.gpower,o_gun.image_angle), 0, c_white, 1, 0.5, 2);

physics_particle_group_polygon();

repeat (irandom_range(3,8)) {

physics_particle_group_add_point(irandom_range(-2,2)*15, irandom_range(-2,2)*15);

}

blob = physics_particle_group_end();

So what I'm doing is creating a polygon that has between 3 and 8 corners centered around the tip of the gun (at _x, _y) , at a random angle, with a velocity based on a variable called gpower that I have as part of the o_gun object.  The 0.5 that you see in the physics_particle_group_begins line is the strength of the bond between the slime particles.  If it was a 1 it would stick together and be relatively hard.  0 would pretty much break apart on impact.  I picked 0.5 because it made it pretty stretchy but little bits can still break off occasionally.

It's not shown here, but I also run a check to make sure there are enough particles of slime so that they come out a relatively consistent size.

Oh really interesting! I used GameMaker 8 and GameMaker studio 1 in the past, but switched to Unity at some point. I never knew GameMaker studio 2 had physics like this! :O Thanks a lot for sharing this! Really impressive!

About the tutorial thing, I completely understand, haha XD I think you did a great job with this last minute tutorial!

Happy to share!  

I'm not really sure when they added them to GMS2 or if it's been there all along.  I didn't start using it until version 2.3 (which I understand had a bunch of updates over GMS2).