%George Fehr
%April 21, 2005
%program to make a border of circles and other graphics
setscreen ("graphics:800;600,position:100;100,nocursor")
colorback (black)
cls
%declare variables to draw the border
var x : int := 20
var y : int := 0
var x2 : int := 20
var y2 : int := 20
var x3 : int := 300
var y3 : int := 150
var col1 : int
var col2 : int
var col3 : int
var font := Font.New ("arial:50")
var iNum : int
%draw the bottom line of circles
for i : 1 .. 20
%random color
col1 := Rand.Int (1, 255)
y := 20
%draw circle
Draw.FillOval (x, y, 20, 20, col1)
delay (10)
%move the x
x := x + 40
end for
%draw the left line of circles
for i : 1 .. 20
col1 := Rand.Int (1, 255)
x := 20
Draw.FillOval (x, y, 20, 20, col1)
y := y + 40
delay (10)
end for
%draw the right line of circles
for i : 1 .. 20
col1 := Rand.Int (1, 255)
x := 780
Draw.FillOval (x, y2, 20, 20, col1)
y2 := y2 + 40
delay (10)
end for
%draw the top line of circles
for i : 1 .. 20
col1 := Rand.Int (1, 255)
y := 580
Draw.FillOval (x2, y, 20, 20, col1)
x2 := x2 + 40
delay (10)
end for
for a : 1 .. 50
col2 := Rand.Int (1, 255)
Font.Draw ("Graphics Challenge 1", 60, 350, font, col2)
delay (10)
View.Update
end for
for b : 1 .. 40
iNum := Rand.Int (1, 4)
col3 := Rand.Int (1, 255)
if iNum = 1 then
Draw.FillBox (x3, y3, x3 + 100, y3 + 100, col3)
delay (100)
View.Update
Draw.FillBox (x3, y3, x3 + 100, y3 + 100, 7)
elsif iNum = 2 then
Draw.FillStar (x3, y3, x3 + 100, y3 + 100, col3)
delay (100)
View.Update
Draw.FillStar (x3, y3, x3 + 100, y3 + 100, 7)
elsif iNum = 3 then
Draw.FillMapleLeaf (x3, y3, x3 + 100, y3 + 100, col3)
delay (100)
View.Update
Draw.FillMapleLeaf (x3, y3, x3 + 100, y3 + 100, 7)
elsif iNum = 4 then
Draw.FillOval (x3 + 50, y3 + 50, 50, 50, col3)
delay (100)
View.Update
Draw.FillOval (x3 + 50, y3 + 50, 50, 50, 7)
end if
end for
delay (1000)
Font.Draw ("By: George Fehr", 150, 250, font, 2)
|