Canadian Flag Program
Author |
Message |
Mr. T
|
Posted: 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 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Trojan Man
|
Posted: Sat Jan 29, 2005 12:07 am Post subject: (No 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.
code: |
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, maxcol div 2 - 9)
put "******************" ..
locate (2, maxcol div 2 - 9)
put "* CANADIAN FLAG! *" ..
locate (3, maxcol div 2 - 9)
put "******************" ..
delay (100)
exit when col = 31
a := a + 30
b := b + 30
drawfillmapleleaf (30, 250 - a, 0, 280 - b, 0)
drawfillmapleleaf (420, 250 - a, 450, 280 - b, 0)
drawfillmapleleaf (0 + a, 0, 30 + b, 30, 0)
drawfillmapleleaf (420 - a, 0, 450 - b, 30, 0)
end loop
|
|
|
|
|
|
|
1337_brad
|
Posted: 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.
code: |
for i: 1..maxy by 30
Draw.FillMapleLeaf(10,i,50,i+30,red)
end for
|
And just adjust the sizes according to what size you want. |
|
|
|
|
|
Trojan Man
|
Posted: Sat Jan 29, 2005 1:21 am Post subject: (No 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. |
|
|
|
|
|
1337_brad
|
Posted: Sat Jan 29, 2005 1:26 am Post subject: View.Update |
|
|
That is why turing made a sexy command called View.update =D |
|
|
|
|
|
Trojan Man
|
Posted: Sat Jan 29, 2005 2:08 am Post subject: (No 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:
code: |
var col : int := 16
var a : int := 0
setscreen ("graphics:450;250,nobuttonbar,nocursor")
colourback (4)
cls
for x : 1 .. maxx div 2 by 30
colour (col)
col += 4
locate (1, maxcol div 2 - 9)
put "******************" ..
locate (2, maxcol div 2 - 9)
put "* CANADIAN FLAG! *" ..
locate (3, maxcol div 2 - 9)
put "******************" ..
a := a + 30
drawfillmapleleaf (30, 245 - a, 0, 275 - a, 0)
drawfillmapleleaf (420, 245 - a, 450, 275 - a, 0)
drawfillmapleleaf (30 + x, 0, 60 + x, 30, 0)
drawfillmapleleaf (392 - x, 0, 422 - x, 30, 0)
delay (100)
end for
|
|
|
|
|
|
|
|
|