Computer Science Canada Billy's Snow |
Author: | Flashkicks [ Mon Apr 26, 2004 10:49 am ] | ||
Post subject: | Billy's Snow | ||
This is a program I made with some help via Delta and ideas from other Compsci Members.. It is just snow falling down- However; you can click with the mouse to change its direction.. I wanted it to be so that the direction FOLLOWS the direction of the mouse. [Scroll the mouse to the FAR LEFT- and the snow will blow really hard to the left--scroll it slightly past the centre to the right, and the snow would blow calmly to the right..etc] buuuuut I am unfortunately not very good with detecting the mouse locations like this..
Enjoy! |
Author: | Raugrist [ Mon Apr 26, 2004 11:26 am ] |
Post subject: | |
Yeah, I noticed that moving the mouse actually doesn't affect the direction the snow blows in. In fact, the directions don't change until you click the mouse, and even then it doesn't matter where the mouse is. All you programmed it to do was cycle between 3 different possible ways of falling when you click the mouse. You can actually check the mouse x coordinate (mx) with relation to the middle of the screen (maxx div 2) to decide how fast the snow moves along the x axis. That is, get (mx - maxx div 2) for the speed and just add that to each snowflakes x coordinate. EDIT: well, something like that. Maybe just a percentage of (mx - maxx div 2) so it doesn't go insanely fast when you move away from the middle. So use (mx - maxx div 2) div 40 or something. Or try this line, so that the snowflakes in the back move a little bit slower: snow (i).x += round ((mx - maxx div 2) / 40 / (4 - snow (i).size)) |
Author: | Paul [ Mon Apr 26, 2004 2:28 pm ] |
Post subject: | |
Am I the only one that found the first effect really really cool? |
Author: | Flashkicks [ Mon Apr 26, 2004 6:57 pm ] |
Post subject: | |
Raugrist, I am pretty sure I stated that the mousewhere stuff is wut i WANTED to ADD in yet. but if I did not mention that- thwen i apologize- that is wut I had intentions of stating. Im sorry.. But other than that- thank you for the Code ideas.. I shall try it out nd show you how it turns out once it is done!! |
Author: | Mazer [ Tue Apr 27, 2004 4:44 am ] |
Post subject: | |
He probably just missed it. Actually, the first time I read your post I missed it too, it looked like you were saying that was how your program worked instead of how you wanted it to work. |