Slime

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
922
I could use some help on how to create some kind of slime in a 2d game. I've been looking into different physics-engines.
What other available options are there?. It doesn't have to be "realistic" at all, just some kind of slime that can stick to walls and bounce around

Do you think it would be possible to do using some technique?
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
644
Your game is in side view, right?
It is a bit hard to guess, what you are expecting as a result.
By "using some technique" you are saying that you want to avoid drawing the slime by hand including its animation frames, right?

You could combine some simple physics for bouncing around like it is done in the breakout example by ferdi with some particle effects to make the visuals of slime. For that I would experiment with the particles in ignitionX. I remember there is one that looks already a bit like plasma. For example using an image like the one for blobmonster and move multiple ones in circles while changing its alpha value or having slightly different color tones. Just be careful with setcolor on html target, as it slows down heavily there.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
922
Thanks! Something like this is what I'm building now, it's hard to get the phsyics right but I'm using water and sand and trying to add softness to it. Right now it is not working as good as I was hoping but I will try a few weeks before I give up.

Slime.png
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
922
I never had any problem with SetColor on the web platform or any other. Cerberus X gives me 60fps on all tested devices, even when I use 2000+ SetColor commands per frame.

Circles themselvs can be slow when they are big but I can use images and stretch those :)
 

Phil7

Administrator
CX Code Contributor
3rd Party Tool Dev
Joined
Jun 26, 2017
Messages
644
I never had any problem with SetColor on the web platform
I guess it is only an issue with mojo not mojo2 then. If you try the firepaint example by mak you'll see. Just uncomment all the setcolor lines.


Regarding your sketches you are trying to achieve much more complex slime than I was expecting.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
922
Ah okay, Mojo1 does not have many advantages except that it has a writepixel that performs amazing on Android, my god it's quick. You can draw 640x400 with 60 fps. You'll get 4fps on other platforms. Android really sticks with old API I guess.

With Mojo2 you would use DrawRect with a size of 1,1 to do the same with (almost) the same speed. Not quiet but close enough. This was one of the reasons I chose Mojo2 for the game.


Nah I don't think it will be complex I just it need some time to get everything just right. I will use a simple water algorithm (that picks 4 tiles around the centered one and average them as the new centered one) to make things "bounce" when the slime lands again. The only thing that I really need to pay attention do is too make react a little bit better than the usual water algorithm and the idea that you describe with circle is really nice. I think it will work.
 

Jimmy

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
922
SetColor might be slow in Mojo1 because it uses displaylists which is considered deprecated in the Open Gl standard.

I've I think I've seen that in Mojo2 too when using Displaylists. Thay are always slower and are sensitive to states like SetColor. I will try to get some time and check that more carefully when I get home.
 
Top Bottom