Help with "Christmas Animations"
Author |
Message |
nipressure
|
Posted: Tue Dec 04, 2007 11:10 am Post subject: Help with "Christmas Animations" |
|
|
I have to make lots of animations for my school (its like a project).
and the program has to relate to holidays and include a lot of animations.
I chose christmas, and I've already done some animations, but I'm having
difficulty making snowflakes. For example,
process snowflake
loop
for decreasing Y:400..152
drawfilloval (225,Y-1,2,2,0)
delay (3)
drawfilloval (225,Y,2,3,blue)
end for
end loop
end snowflake
fork snowflake
this thing only makes one snowflake, and its just one snowflake keep coming back down.
I'm sure there are many other ways to do it, and make it go side ways and stuff, but it's my first
year doing turing and I'm not really good at it. I need help!
P.S. my snowflake keeps going through my snowman, house...etc(it erases the thing that it passes) is there a way to stop it? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
HeavenAgain
![](http://compsci.ca/v3/uploads/user_avatars/139122102045e603120b143.jpg)
|
Posted: Tue Dec 04, 2007 12:05 pm Post subject: RE:Help with "Christmas Animations" |
|
|
code: | process snowflake
loop
var randomx : int := Rand.Int(0,maxx)
var randomy : int := Rand.Int(0,maxy)
for decreasing Y:400..152
drawfilloval (randomx,Y-1+randomy,2,2,0)
delay (3)
drawfilloval (randomx,Y+randomy,2,3,blue)
end for
end loop
end snowflake
fork snowflake
|
LOL, i have no idea how the heck this suppose to look like, but the idea is, dont use process, because it can get really screwed up, and what you should do is use a random x and y cord. and call to it many times, and you'll get your snow flakes at random place falling down
as for your snow flake earsing stuff, draw and update screen in order; draw snow flake first -->> draw snowman -->> clearn screen -->> draw snow flake (but y cord minus) -->> draw snowman (again) -->> clearn screen .... and so on |
|
|
|
|
![](images/spacer.gif) |
r.m_spy
|
Posted: Tue Dec 04, 2007 1:45 pm Post subject: Re: Help with "Christmas Animations" |
|
|
nipressure @ Tue Dec 04, 2007 11:10 am wrote: I have to make lots of animations for my school (its like a project).
nice idea
procedure snowflake
loop
for decreasing Y:400..152
drawfilloval (225,Y-1,2,2,0)
delay (3)
drawfilloval (225,Y,2,3,blue)
end for
end loop
end snowflake
fork snowflake
this thing only makes one snowflake, and its just one snowflake keep coming back down.
I'm sure there are many other ways to do it, and make it go side ways and stuff, but it's my first
year doing turing and I'm not really good at it. I need help!
P.S. my snowflake keeps going through my snowman, house...etc(it erases the thing that it passes) is there a way to stop it? |
|
|
|
|
![](images/spacer.gif) |
Nick
![](http://compsci.ca/v3/uploads/user_avatars/19644337547e837b41d67a.png)
|
Posted: Tue Dec 04, 2007 3:14 pm Post subject: RE:Help with "Christmas Animations" |
|
|
uhhh y did u quote that? and by the way heaven again states is the best so say u want 4 snowflakes code: | var snowx,snowy:array 1..4 of int
loop
cls
for i:1..4
%drawsnow flakes
%snowflakeDraw(i)
snowy(i)-= 3
snowx(i)+=1%this will look like the wind is blowing to the right
end for
%draw other stuff
View.Update
end loop
|
|
|
|
|
|
![](images/spacer.gif) |
belarussian
|
Posted: Wed Nov 18, 2009 6:13 pm Post subject: Re: Help with "Christmas Animations" |
|
|
HERE IS THE REAL CODE THOSE NOOBS KNOW NOTHING THEIR SNOW SUCKS
View.Set ("offscreenonly")
%set up the snow
const NoOfFlakes := 400
var flakeX : array 1 .. NoOfFlakes of int
var flakeY : array 1 .. NoOfFlakes of int
for flake : 1 .. NoOfFlakes
flakeX (flake) := Rand.Int (0, maxx)
flakeY (flake) := Rand.Int (0, maxy)
end for
loop
for flake : 1 .. NoOfFlakes
%Drop The Flake
flakeY (flake) -= Rand.Int (1, 5)
%flakeX (flake) += Rand.Int (-1, 1)
if flakeY (flake) < 0 then
flakeY (flake) := maxy
flakeX (flake) := Rand.Int (0, maxx)
end if
Draw.FillOval (flakeX (flake), flakeY (flake), 1, 1, white)
end for
%Update the screen (because of offscreen only)
View.Update
delay (25)
end loop |
|
|
|
|
![](images/spacer.gif) |
B-Man 31
![](http://compsci.ca/v3/uploads/user_avatars/370363944af8c60a7db3b.jpg)
|
Posted: Wed Nov 25, 2009 9:34 pm Post subject: Re: Help with "Christmas Animations" |
|
|
belarussian @ Wed Nov 18, 2009 6:13 pm wrote: HERE IS THE REAL CODE THOSE NOOBS KNOW NOTHING THEIR SNOW SUCKS
Have you even tried to run your code!?
You might want to add a background colour! white snow on a white background doesn't show up. also, maybe next time you want to clear the snowflakes before drawing them. so before you go around calling them noobs, make sure your not one either. ![Very Happy Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
|
|