Skip to content

Commit 56df36d

Browse files
committed
silly sound face sample
1 parent 49f0050 commit 56df36d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

sound/sound_face.bas

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
option predef load modules
2+
import android
3+
android.sensor_on(0)
4+
s = android.sensor
5+
j = s.z
6+
i = 250
7+
dur = 60
8+
9+
x=xmax/2
10+
y=ymax/2
11+
r1=min(x,y)*.5
12+
r2=min(x,y)*.3
13+
er=20
14+
ew=r1/2.5
15+
eh=r1/3
16+
17+
while 1
18+
s = android.sensor
19+
f = int(s.z * 50)
20+
if (abs(f - j) > 15) then
21+
j = f
22+
f1 = f * rnd * 100
23+
f2 = f1 + 800
24+
for f = f1 to f2 step i: sound f, dur: next f
25+
for f = f2 to f1 step i: sound f, dur: next f
26+
27+
cls
28+
circle x,y,r1
29+
if (rnd > .5) then
30+
circle x+ew, y-eh, er color 7 filled
31+
else
32+
circle x+ew, y-eh, er
33+
endif
34+
if (rnd > .5) then
35+
circle x-ew, y-eh, er color 7 filled
36+
else
37+
circle x-ew, y-eh, er
38+
endif
39+
if (j > 400) then
40+
arc x, y, r2, rad(30), rad(150)
41+
else
42+
line x-r2, y+eh, x+r2, y+eh
43+
endif
44+
showpage
45+
46+
endif
47+
delay 100
48+
wend

0 commit comments

Comments
 (0)