File tree Expand file tree Collapse file tree 2 files changed +39
-10
lines changed Expand file tree Collapse file tree 2 files changed +39
-10
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"#" : [
3
+
4
+ " Photo" ,
3
5
" BlueRect" ,
4
- " RedEllipse" ,
5
- " Photo"
6
+ " RedEllipse"
6
7
],
7
8
"BlueRect" : {
8
9
"type" : " rectangle" ,
Original file line number Diff line number Diff line change 5
5
rectangle BlueRect
6
6
ellipse RedEllipse
7
7
ellipse GreenCircle
8
- text WhiteText
9
8
file File
10
9
variable Spec
11
10
variable UpDown
12
11
variable Left
13
12
variable Top
13
+ variable Steps
14
+ variable Step
15
+ variable DX
16
+ variable DY
14
17
variable N
18
+ variable X
19
+ variable Y
20
+ variable L
21
+ variable T
15
22
16
23
! debug step
17
24
29
36
on click RedEllipse print `Click Red`
30
37
attach GreenCircle to `greencircle`
31
38
on click GreenCircle print `Click Green`
32
-
33
- put attribute `left` of RedEllipse into Left
34
- put attribute `top` of RedEllipse into Top
39
+
40
+ gosub to InitEllipse
35
41
36
42
clear UpDown
37
43
put 0 into N
48
54
put 0 into N
49
55
clear UpDown
50
56
end
51
- move RedEllipse to Left Top
52
- add 5 to Left
53
57
end
54
58
else
55
59
begin
62
66
put 0 into N
63
67
set UpDown
64
68
end
65
- move RedEllipse to Left Top
66
- take 5 from Left
67
69
end
68
70
increment N
71
+ gosub to MoveEllipse
69
72
end
70
73
show screen
71
74
stop
75
+
76
+ InitEllipse:
77
+ put attribute `left` of RedEllipse into Left
78
+ put attribute `top` of RedEllipse into Top
79
+ put random 340 into X
80
+ put random 280 into Y
81
+ add 50 to X
82
+ add 50 to Y
83
+ take Left from X giving DX
84
+ take Top from Y giving DY
85
+ put 20 into Steps
86
+ put 0 into Step
87
+ return
88
+
89
+ MoveEllipse:
90
+ multiply DX by Step giving X
91
+ divide X by Steps
92
+ add X to Left giving L
93
+ multiply DY by Step giving Y
94
+ divide Y by Steps
95
+ add Y to Top giving T
96
+ move RedEllipse to L T
97
+ increment Step
98
+ if Step is Steps gosub to InitEllipse
99
+ return
You can’t perform that action at this time.
0 commit comments