(solved)How do I destroy particles?

Get help using Construct 2

Post » Fri May 15, 2015 9:25 am

I have done a character that starts spawning bubbles when he is under water.The way i have done it, is another sprite that is pinned to characters mouth and when that sprite is under water (overlapping water), character will start spawning the bubbles.

Now the problem is that that i want the bubbles not be able to be anywhere else except into the water. (air flying bubbles are not realistic)

I'll show you a picture:
Image

So how do i destroy those bubbles when they are not anymore in water?
Last edited by sorbias on Fri May 15, 2015 11:17 am, edited 1 time in total.
B
11
S
1
Posts: 63
Reputation: 658

Post » Fri May 15, 2015 9:31 am

You might want to change timeout and or other properties based on the position of the particle object compared to the water surface..

Another way would be to use a blendmode to only show the particles overlapped by the water..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 15, 2015 10:13 am

That first one does not work, because the water level can be anything.

About the blend mode. How should I do that? Is there some sort of layer mask thing that I can use for this? I know i can change the blend mode, but should i put the particles over water layer and which blend mode then would be best?

Now the particles are pinned to character, because i don't wanna them appear from wrong part of character. (only mouth and nose) Can this be problem?) If character is not in water, it has spawn rate 0 and in water it's 2.

edit: now the bubbles appear at the same layer with water, but i cannot find any good blend mode for it. The problem is that the background color and contrast and everything can change and the water color can change also. So it may be impossible to find some easy "color trick" for this. :/
Last edited by sorbias on Fri May 15, 2015 10:38 am, edited 3 times in total.
B
11
S
1
Posts: 63
Reputation: 658

Post » Fri May 15, 2015 10:30 am

I'm not sure why the first one wouldn't work..
Water.BBoxTop should get you the y-coordinate of the top of the water, compare the distance between it and your particle-objkect and it should work fine..

If you want to use the blendmode putting the particle object above the water and setting it's blendmode to source-atop should do the trick..
Just put the water and the particle-object in one layer and set force own texture in the layer properties to yes..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 15, 2015 10:49 am

I tried that "source atop" thing, but the particles still appear in places they should not. The particles are at the same layer with water with source atop and they are top of everything. On that layer is not anything else than bubbles and water sprite.
Water is basically one alpha channeled big sprite that has a water wave effect applied and it is rising with custom movement to up.

I also tried destination atop, but it did not work either.

https://www.scirra.com/manual/146/effects
B
11
S
1
Posts: 63
Reputation: 658

Post » Fri May 15, 2015 11:04 am

Is the layer with the water and the particles set to Force own texture?

https://dl.dropboxusercontent.com/u/485 ... icles.capx
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 15, 2015 11:17 am

About the force own texture, I do not know what that means. (And now i don't still know, but it worked.) Thank you again LittleStain! You have helped me a lot with this project!
B
11
S
1
Posts: 63
Reputation: 658

Post » Fri May 15, 2015 11:28 am

Oh, another question about this. Now the bubbles are masked with the water layer's alpha channel, but they are hardly visible, because water is almost transparent. Can i do anything to that?
B
11
S
1
Posts: 63
Reputation: 658

Post » Fri May 15, 2015 12:06 pm

This is a quick example of the other method without blendmodes (you can drag the particles):

https://dl.dropboxusercontent.com/u/485 ... dmode.capx

Offcourse these settings can be optimized to get even more the effect you would like to achieve..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 15, 2015 4:08 pm

Thank you also about that another way to set this. :) I think I'm not advanced enough for using this trick yet, but maybe in my next game this could be handy to know that it's possible to use that kind of code in construct. Now I think I just approve it as a feature that the bubbles are not so visible. This game i am doing is already so big, that i need to save time so it can be released before christmas... :D
B
11
S
1
Posts: 63
Reputation: 658


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests