Computer Science Canada My rain program |
Author: | ZeroPaladn [ Tue Sep 13, 2005 1:30 pm ] |
Post subject: | My rain program |
Hi, im back after the summer. sorry about that. anyways this is my first program since i am back in school. if you can in any way shorten it or mod it, id be happy to see your input. |
Author: | MiX-MaztA-M8riX [ Tue Sep 13, 2005 3:23 pm ] |
Post subject: | |
Dont have turing at home, but this type of program hasnt been beaten to death yet.. thank god ![]() anywho, at least you used ThickLines ![]() |
Author: | [Gandalf] [ Tue Sep 13, 2005 3:55 pm ] |
Post subject: | |
Good try, but it would be better if the rain actually moved down. Still, this is a pretty simple way and it works. I recall seeing lots of rain/snow programs before, but it's always nice to have fresh input into something ![]() |
Author: | Delos [ Tue Sep 13, 2005 7:17 pm ] | ||||||||||
Post subject: | |||||||||||
Tidying up time!
You need arrays!
Or even better yet, records will help you to centralise everything.
Now, we need to expidite your coding a little:
We'll make a function for that.
We will take note that this does not actually animate the rain. We simply get lines drawn randomly on the screen. To achieve said effect, simply set up the rain array initially, then change the x- and y- values as necassary. This will then form a very primitive particle engine. Note that with this design, one can also change the 'rain' type to include other properties too. Of course, remember to change the initialization fcns to reflect these changes as well. |
Author: | ZeroPaladn [ Wed Sep 14, 2005 7:14 am ] |
Post subject: | |
thanks for all your help, im currently working on another where the rain moves in a PREDICTABLE path, instead of random lines. this should help me a bit, and im still learing arrays, so i didnt put them in. now i know what to do, and V2 is coming! |
Author: | codemage [ Tue Sep 20, 2005 1:52 pm ] |
Post subject: | |
Possible mods: *Randomize the thickness of your rain (Rand.Int(2,4) wood look good with your v.1 settings.) *Occasional Lightning *Changing intensity of rain (heavy / light) |
Author: | ZeroPaladn [ Tue Sep 20, 2005 3:14 pm ] |
Post subject: | |
all good ideas, but, alas, im working on a new project (see turing applications). Its a Decimal -> Binary converter. My comp Engineering teacher said i could do it for extra credit... heheh... free marks... |
Author: | goboenomo [ Thu Oct 13, 2005 11:41 am ] |
Post subject: | |
[Gandalf] wrote: Good try, but it would be better if the rain actually moved down. Still, this is a pretty simple way and it works.
I recall seeing lots of rain/snow programs before, but it's always nice to have fresh input into something ![]() Rain should have moved down for sure.. and i think it would have looked a bit better it the droplets were more oval shaped. |
Author: | ZeroPaladn [ Fri Oct 14, 2005 8:45 am ] |
Post subject: | |
is it even possible to draw ovals on an angle (unless you use Pic.New and Pic.Rotate) |
Author: | [Gandalf] [ Fri Oct 14, 2005 2:51 pm ] |
Post subject: | |
Draw.Arc ...Or else you could just use boxes/lines... |
Author: | belarussian [ Wed Nov 18, 2009 10:10 am ] |
Post subject: | Re: My rain program |
Ok IF YOU WANT REAL RAIN HERE IT IS const NoOfrain := 400 var rainX : array 1 .. NoOfrain of int var rainY : array 1 .. NoOfrain of int for rain : 1 .. NoOfFlakes rainX (rain) := Rand.Int (0, maxx) rainY (rain) := Rand.Int (0, maxy) end for for rain : 1 .. NoOfrain %Drop The rain rainY (rain) -= Rand.Int (1, 5) %rainX (rain) += Rand.Int (-1, 1) if rainY (rain) < 0 then rainY (rain) := maxy rainY (rain) := Rand.Int (0, maxx) end if Draw.FillOval (rainX (rain), rainY (rain), 1, 1, blue) end for %Update the screen (because of offscreen only) View.Update delay (25) |
Author: | Turing_Gamer [ Wed Nov 18, 2009 12:09 pm ] |
Post subject: | Re: My rain program |
belarussian @ Wed Nov 18, 2009 10:10 am wrote: ... for rain : 1 .. NoOfFlakes rainX (rain) := Rand.Int (0, maxx) rainY (rain) := Rand.Int (0, maxy) end for ... Do you mean... for rain : 1 .. NoOfrain rainX (rain) := Rand.Int (0, maxx) rainY (rain) := Rand.Int (0, maxy) end for |
Author: | belarussian [ Tue Dec 08, 2009 9:18 pm ] |
Post subject: | RE:My rain program |
ya i do mean that yah |
Author: | belarussian [ Tue Dec 08, 2009 9:23 pm ] |
Post subject: | RE:My rain program |
View.Set ("graphics:1024;768,nobuttonbar,nocursor,offscreenonly") loop Draw.Fill (100, 100, brightred, green) const NoOfrain := 400 var rainX : array 1 .. NoOfrain of int var rainY : array 1 .. NoOfrain of int for rain : 1 .. NoOfrain rainX (rain) := Rand.Int (0, maxx) rainY (rain) := Rand.Int (0, maxy) end for for rain : 1 .. NoOfrain %Drop The rain rainY (rain) -= Rand.Int (1, 5) %rainX (rain) += Rand.Int (-1, 1) if rainY (rain) < 0 then rainY (rain) := maxy rainY (rain) := Rand.Int (0, maxx) end if Draw.FillOval (rainX (rain), rainY (rain), 1, 1, blue) end for %Update the screen (because of offscreen only) View.Update delay (100) end loop |
Author: | mirhagk [ Tue Dec 08, 2009 11:08 pm ] | ||
Post subject: | RE:My rain program | ||
you want rain, ill give you rain
|
Author: | belarussian [ Thu Dec 10, 2009 9:14 pm ] |
Post subject: | RE:My rain program |
your not really doing any rain that is different than mine you are just changing the y value and making it faster. so yeah have a good day |
Author: | Euphoracle [ Thu Dec 10, 2009 9:19 pm ] |
Post subject: | RE:My rain program |
...You're aware this thread was started in 2005, right? |
Author: | Srlancelot39 [ Fri Jan 08, 2010 2:15 pm ] | ||
Post subject: | Re: RE:My rain program | ||
mirhagk @ Tue Dec 08, 2009 10:08 pm wrote: you want rain, ill give you rain
sweet.... I made some modifications too...I altered the code in the first function to make snow, light rain, heavy rain, and even a tornado effect lmao! |
Author: | Srlancelot39 [ Fri Jan 08, 2010 2:22 pm ] |
Post subject: | Re: RE:My rain program |
belarussian @ Tue Dec 08, 2009 8:23 pm wrote: View.Set ("graphics:1024;768,nobuttonbar,nocursor,offscreenonly")
loop Draw.Fill (100, 100, brightred, green) const NoOfrain := 400 var rainX : array 1 .. NoOfrain of int var rainY : array 1 .. NoOfrain of int for rain : 1 .. NoOfrain rainX (rain) := Rand.Int (0, maxx) rainY (rain) := Rand.Int (0, maxy) end for for rain : 1 .. NoOfrain %Drop The rain rainY (rain) -= Rand.Int (1, 5) %rainX (rain) += Rand.Int (-1, 1) if rainY (rain) < 0 then rainY (rain) := maxy rainY (rain) := Rand.Int (0, maxx) end if Draw.FillOval (rainX (rain), rainY (rain), 1, 1, blue) end for %Update the screen (because of offscreen only) View.Update delay (100) end loop lol...that looks more like particle physics than rain |
Author: | Srlancelot39 [ Tue Sep 07, 2010 11:12 pm ] |
Post subject: | Re: RE:My rain program |
belarussian @ Thu Dec 10, 2009 8:14 pm wrote: your not really doing any rain that is different than mine you are just changing the y value and making it faster. so yeah have a good day
really? looks significantly different to me. besides, mirhagk is a good sport, you're not - "so yeah have a good day".....honestly? sounds like jealousy to me... |
Author: | andrew. [ Wed Sep 08, 2010 6:57 am ] |
Post subject: | Re: RE:My rain program |
To quote Euphoracle: Euphoracle @ Thu Dec 10, 2009 9:19 pm wrote: ...You're aware this thread was started in 2005, right? |
Author: | Dan [ Wed Sep 08, 2010 9:18 am ] |
Post subject: | RE:My rain program |
Thread locked due to necroposting. |