Computer Science Canada Canadian Flag Program |
| Author: | Mr. T [ Fri Jan 28, 2005 10:37 pm ] |
| Post subject: | Canadian Flag Program |
how do i make the mapleleafs go all the way up to the top? ****************************** var col :int :=16 var a :int :=0 var b :int :=0 setscreen ("graphics:450;250,nobuttonbar,nocursor") colourback (4) cls loop colour (col) col+=1 locate (1,20) put "******************":56.. put "* CANADIAN FLAG! *":56.. put "******************" delay (100) exit when col =31 a+=30 b+=30 drawfillmapleleaf (30,210-a,0,240-b,0) drawfillmapleleaf (420,210-a,450,240-b,0) drawfillmapleleaf (0+a,0,30+b,30,0) drawfillmapleleaf (420-a,0,450-b,30,0) end loop |
|
| Author: | Trojan Man [ Sat Jan 29, 2005 12:07 am ] | ||
| Post subject: | |||
Ok, This works, except there are some extra leafs at the bottom, just take those out. I only centered ur text and made your leafs start drawing higher.
|
|||
| Author: | 1337_brad [ Sat Jan 29, 2005 12:45 am ] | ||
| Post subject: | for loop anybody? | ||
I suggest using a for loop, and also the Pic.New function, rather than redrawing the whole thing everytime.
And just adjust the sizes according to what size you want. |
|||
| Author: | Trojan Man [ Sat Jan 29, 2005 1:21 am ] |
| Post subject: | |
Yeah, that would be easy to make, i was gonna write that, but I thought the reason he did the way it is, is because he wanted the leafs to appear with the text in kinda like a smooth animation. |
|
| Author: | 1337_brad [ Sat Jan 29, 2005 1:26 am ] |
| Post subject: | View.Update |
That is why turing made a sexy command called View.update =D |
|
| Author: | Trojan Man [ Sat Jan 29, 2005 2:08 am ] | ||
| Post subject: | |||
I thought leet_brad said creating a separate for loop for the animation, I'm guessing he just meant to use 1 for loop. I tried that and it looks better and shortens the code. Here:
|
|||