How do I make my rain particles fall from the upper right to the lower left, (make it look as if wind where pushing it)?
How to make Rain Particles fall sideways?
(5 posts) (2 voices)-
Posted 10 months ago #
-
If you are using a physics engine, you could fiddle with gravity.
If you dont want to do that, you could manually apply sideways motion.Posted 10 months ago # -
how do i manually apply sideways motion?
Posted 10 months ago # -
Iterate through the bodies, and simply adjust Y position.
body.pos = CGPointMake( body.pos.x, body.pos.y + ( movementPrSecond * timeInterval ) );Without having thought to much about it, this would be my first solution. Would be fast, and very easy to implement small changes. Maybe a subtle randomness, or areas with slightly more movement, to simulate small gusts of winds ... or something.
EDIT:
Would of cause probably be X direction.EDITEDIT:
This works with chipmunk, but since box2d uses another approach for collision detection, it might break something to manually move bodies around. I dont know.Posted 10 months ago # -
thank you Birkemose! :D
Posted 10 months ago #
Reply
You must log in to post.