Skip to content

Commit 4dc4a2c

Browse files
committed
demo script
1 parent 9c8cf6b commit 4dc4a2c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

scripts/wave.ecg

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414
variable L
1515
variable N
1616

17+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18+
! Create the window and start the graphics
19+
1720
create window title `Mexican Wave` at 300 300 size 640 480 fill color 255 255 200
1821
run graphics
1922

23+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24+
! Define a set of 10 bars
25+
2026
put `{
2127
` "#": [
2228
` "Bar0",
@@ -33,6 +39,9 @@
3339
`
3440
`` into Spec
3541

42+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43+
! Create the specifications for each of the 10 barsm then render the spec
44+
3645
put 0 into N
3746
while N is less than 10
3847
begin
@@ -59,6 +68,9 @@
5968

6069
render Spec
6170

71+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
72+
! Attach a script variable to each of the 10 bars
73+
6274
divide the window height by 2 giving Mid
6375
multiply Mid by 9 giving Range
6476
divide Range by 10
@@ -75,8 +87,10 @@
7587
increment N
7688
end
7789

90+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
91+
! This section animates the bars growing up fro the bottom of the screen
92+
7893
wait 1
79-
! Run the setup
8094
put 0 into N
8195
while N is less than 10
8296
begin
@@ -96,9 +110,12 @@
96110
set attribute `height` of Bar to Height
97111
increment N
98112
end
113+
on click Bar print `Click ` cat the index of Bar
114+
end
99115

116+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
117+
! This section runs the main animation
100118
wait 1
101-
! Run the main animation
102119
while true
103120
begin
104121
put 0 into N

0 commit comments

Comments
 (0)