Wind Direction and Speed Change?

DonaldMDonaldM Member Posts: 48
edited November -1 in Working with GS (Mac)
Games like "paper toss" are based around wind affecting an object to make it vary in movement. Can GS be set up to have wind constantly changing direction and speed (reasonably slow changes, like real wind) to affect an object fired into the air?

This would be a side view so it would be just right and left changes, not like a compass spinning around in circles or anything.

Thanks guys

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    I have a fan in my project which tenrdrmer and tshirtbooth helped with the logic. See thread here:

    http://gamesalad.com/forums/topic.php?id=14808#post-113704

    I took this and created the direction as an attribute so I could place a left and right fan. I have also seen somewhere discussion of determining swipe direction so if you were looking for wind directed by swipe movement I think you might be able to combine these .. maybe the actors which are the wind are moved to your touch in the direction of your swipe?
  • DonaldMDonaldM Member Posts: 48
    Well my game is a golf game where you try and hit it the furthest. In real life, the distance is determined by the angle and velocity of the wind at that moment. I was looking for a wind that would constantly be moving around, different speeds and direction. I was trying to get this to be a completely random and uncontrollable aspect of gameplay. Does anyone know if this is possible?
  • msonesmsones Inactive, Chef Emeritus Posts: 75
    Not sure if this will help, but you can change a Scene's gravity through an unlocked actor instance. Use interpolate with [random] to change X-axis (or Y-axis, depending upon the orientation of your game) to increase or decrease gravity in all four directions to simulate wind; I bet you could figure out a way pretty easily to add a timer and have wind change at random periods of time to random directions and strengths.

    Just be aware of the fact that gravity will affect all objects, so all these random changes probably can't be compensated for unless an object is immobile.

    Alternatively, if you just have one object (say, a golf ball or a paper airplane) upon which the wind will be acting, you could add a set of custom accelerations using the [random] function and interpolate the changes over time as above.
Sign In or Register to comment.