%J Knudsen
%Music being played
var stopIt : int
stopIt := 0
process playMyMusic
loop
Music.Play (">dbdbefdbdbef 4aaacbacbac 1efgefgefg 4bbbad 2gbgbacefefefab 8efefgbgbefefgbgbefagbccc 8abcdabcddefdefabcdabcddefdef ")
exit when stopIt = 10
end loop
end playMyMusic
% Animation being played
var r : int
var x, y, deltaX, deltaY : int
fork playMyMusic
r := 20
x := r
y := maxy div 2
deltaX := 9
deltaY := 9
View.Set ("graphics:max,max;offscreenonly")
var r2 : int
var x2, y2, deltaB, deltaC, c : int
r2 := 20
x2 := r2
y2 := maxy div 4
deltaB := 9
deltaC := 9
c :=1
colourback (Rand.Int(1,10))
cls
loop
Draw.FillMapleLeaf (x, y, r, r, c)
if y >= maxy - r then
deltaY := -deltaY
elsif y < r then
deltaY := -deltaY
end if
if x > maxx - r then
deltaX := -deltaX
elsif x < r then
deltaX := -deltaX
end if
delay (-10)
Draw.FillMapleLeaf (x, y, r, r, c)
x := x + deltaX
y := y + deltaY
Draw.FillMapleLeaf (x, y, r, r, c)
% View.Update
Draw.FillMapleLeaf (x2, y2, r2, r2, c)
if y2 >= maxy - r then
deltaC := -deltaC
elsif y2 < r then
deltaC := -deltaC
end if
if x2 >= maxx - r2 then
deltaB := -deltaB
elsif x2 < r2 then
deltaB := -deltaB
end if
delay (-10)
Draw.FillMapleLeaf (x2, y2, r2, r2, c)
x2 := x2 + deltaB
y2 := y2 + deltaC
colourback(Rand.Int(1,255))
cls
Draw.FillMapleLeaf (x, y, r, r, c)
Draw.FillMapleLeaf (x2, y2, r2, r2, c)
View.Update
c := (Rand.Int (1,10))
put "falling star"
end loop
%end animation
stopIt := 10
%end music
|