The Daily Click ::. Forums ::. Klik Coding Help ::. water fountain - waterdrops beeing affected by gravity
 

Post Reply  Post Oekaki 
 

Posted By Message

badm1nton



Registered
  01/02/2009
Points
  14
29th March, 2009 at 17:42:09 -

super newbie question.
im trying to make this water fountain, where i have drops of water being shot into the air at random angles, that then should fall to the ground.
i can spawn the drops just fine, but i cant seem to figure out how to make gravity affect them, so they dont just keep flying upwards.
can anyone help ?

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
29th March, 2009 at 17:50:22 -

Well, it depends on what system you're using. When I do particle effects, I always set the particles' X and Y values to their current X and Y values plus their A and B alterable value, respectively. So I could just subtract from the B value and it would continue to fall.

For example:

Always: Create particle at 0,0; Set Value A to random(5) - 3; Set Value B to random(5) - 3; Set X position to X position plus Value A; Set Y position to Y Position plus Value B.

Every little while: Subtract 1 from Value B.

You'd need to mess with the values a bit to get it to work right, I don't have a working system right in front of me to check, but the gist is there.


Alternatively, if you're shooting them out with bouncing ball movements, you can use the direction calculator extension or an equivalent and have the particle slowly rotate toward the down direction. That's not proper looking though so you might want to go with the first system.

Edited by OMC

 

  		
  		

Chloe Sagal

under the influence of FUN

Registered
  19/02/2009
Points
  607

Orange
29th March, 2009 at 18:13:53 -

i have blood in my game which does basically the same thing, except bloodier (blooder than water!? OMG!)

but i use vector movement to do this, set the gravity direction to whatever down is, like 270 or something, then just have some kind of timed trigger thing (mine is actually in a movement loop, but you shouldnt need a loop for it), and every time that event comes, create a drop of water, use the clickteam movement controller to select that drop of water, then using the CMC, set the angle to 135-Random(45). i aslo put in a set x to (x-6)+random(12) to set a random position aswell, but for a fountain that might be redundant. then of cource you need the drops to dissapear so you need an event that states if an alterable value of the drop called transparancy of the drop is greater or equal to 0, then set the semi-trans of the drop + whatever, and set transparancy + the same ammount, then finish with an event that when the transparancy value is greater than or equal to 128, then destroy the drop of water.

 
Patreon: http://www.patreon.com/chloesagal
Twitter: https://twitter.com/ChloeSagal

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
29th March, 2009 at 18:17:37 -

It's easy enough -
Image

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

badm1nton



Registered
  01/02/2009
Points
  14
29th March, 2009 at 19:54:31 -

cool i got it working, thanks for the help

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
29th March, 2009 at 20:01:01 -

Fantastic.

			
  	    

 

  		
  		

-Dark Martin-

The dark is most certainly not your friend

Registered
  05/06/2008
Points
  21

Has Donated, Thank You!KlikCast StarSonic SpeedWii Owner360 Owner
30th March, 2009 at 09:20:38 -

I ussually just use the Pinball movement for fountain like effects...:/

 
<a href="http://s50.photobucket.com/albums/f315/Martin_Bodger/?action=view¤t=signature_stripcopy.png" target="_blank">Image

Eric Lism



Registered
  29/03/2009
Points
  51
30th March, 2009 at 12:38:27 -

What OldManClayton has said works quite well, although i personally use four values, and rename them as X speed, Y speed X accel, Y accel, you add X accel to X speed, and X speed to X position, essentially modelling a simple newtownian physics system. If you mess around with delays you can fine tune that really wellw and this system is quite usable for custom movement systems of all kinds.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click