Wavy lines in java?

I wanted to make some snow flakes falling like in this example:
http://scratch.mit.edu/projects/zombie_penguin/72596

but i wasnt sure what kind of equations the lines would use, or if they even are equations. any ideas?

sin(x)?

Also they seem to move left and right randomly…so…just play around with the Random object? :slight_smile:

What does sin(x) do, do you have any examples? and i dont need them do be random i just want them to go in curved lines

Ah you don’t know trigonometry? Well that’s gonna be a slight problem. :S

nope sorry :frowning:

ok so i figured out what sin(x) does but that makes the waves go horizontal, but i need them to be vertical… any ideas how???

I think you might have some slight problems creating a game if you can’t figure that out yourself… No offence. :persecutioncomplex:

[icode]x = sin(y)[/icode]

And yeah, learn maths.

I know im a real newb with this stuff but could someone make an example? or some pseudo code?

Dude it’s like 2 lines of code, literally
If you can’t solve small problems like this without giant amounts of help from others then you shouldn’t be making games.

Not “shouldn’t make games” but should learn more before starting to make games.

Something as simple as a wavy line? o.O Its not even as complicated as sin(x). You can just generate a random number from -1 to 1 and add that to the position, or something like that. But that wouldn’t be that smooth, so you could use a variation of the “wandering” method. But I think that’s too much for you. o.O

What’s what I was going to say, no-one is incapable of making a game, you just have to learn.

guys im sorry for being a newb but im only in middle school lmao

So am I :smiley:

well i really could use some help… so instead of making fun of my lack of these skills could someone help me out?

Then I suggest you not to jump into game making so quickly. Fully learn Java and code design before jumping into this area. Especially if you don’t know trig :S

However, I shall help this one time:


int value = Math.sin(theta); //keep incrementing theta by any number below Math.PI/4 (play around the numbers for best effect)

The value returned is between -1 and 1. Just add this to the center of the wave path.

Yeah, trig is going to help you with euclidean distance, 3d cameras, direction vectors, noise functions, and practically anything,

Me too :smiley:

I don’t know trigonometry either. If I need it somewhere I have friends who could help.