RotaryPhone Example

For this code to work you must have these image .png files, and these 
sound .mp3 files in your DATA folder.
(dial1.png, roto1.png, rotaryphone.mp3, throwswitch.mp3)

Source Code:

GR.Open 255, 0,0,0
GR.ORIENTATION 1
GR.Screen w,h
GR.BITMAP.LOAD dial_ptr, "dial1.png"
GR.BITMAP.CREATE empty_ptr, 2, 3
GR.BITMAP.DRAWINTO.START empty_ptr
GR.BITMAP.DRAWINTO.End
GR.BITMAP.Draw bd, dial_ptr, x,y
GR.BITMAP.LOAD roto_ptr, "roto1.png"
GR.BITMAP.Draw bp, roto_ptr, 0,0
GR.RENDER
audio.load aft_1, "rotaryphone.mp3"
audio.load aft2, "throwswitch.mp3"
  Let number$="" 
k=165
c=460

Loop:
GR.BOUNDED.TOUCH zero, 145, 275, 215, 325
GR.BOUNDED.TOUCH dial, 16, 427, 171, 479
GR.BOUNDED.TOUCH nine, 95, 260, 145, 300
GR.BOUNDED.TOUCH eight, 38, 221, 93, 261
GR.BOUNDED.TOUCH seven, 30, 159, 79, 206
GR.BOUNDED.TOUCH six, 35, 101, 85, 141
GR.BOUNDED.TOUCH five, 69, 49, 117, 96
GR.BOUNDED.TOUCH four, 123, 31, 173, 68
GR.BOUNDED.TOUCH three, 189, 15, 231,72
GR.BOUNDED.TOUCH two, 235, 59, 292, 99
GR.BOUNDED.TOUCH one, 282, 104, 319, 147


If zero=1 Then Gosub zero
If dial=1 Then Gosub dial
If nine=1 Then Gosub nine
If eight=1 Then Gosub eight
If seven=1 Then Gosub seven
If six=1 Then Gosub six
If five=1 Then Gosub five
If four=1 Then Gosub four
If three=1 Then Gosub three
If two=1 Then Gosub two
If one=1 Then Gosub one

Goto Loop
zero: 
audio.play aft_1 
 GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
Let number$=number$+"0"
gr.text.draw z, k, c, number$
For angle = 0 To 330 Step 30

 GR.ROTATE.START angle, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
gr.text.draw z, k, c, number$
 GR.RENDER
Next angle
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For anglea = 330 To 0 Step -30
 GR.ROTATE.START anglea , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
gr.text.draw z, k, c, number$
 GR.RENDER
Next anglea
audio.Stop


Return


dial: 
audio.play aft2
pause 1000
phone.Call number$
audio.stop
Let number$=""
pause 1000
exit
Return

nine:
 GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26 
audio.play aft_1
Let number$=number$+"9"
For anglenine = 0 To 300 Step 30
 GR.ROTATE.START anglenine, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.draw z, k, c, number$ 
 GR.RENDER
Next anglenine
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For angleninea = 300 To 0 Step -30
 GR.ROTATE.START angleninea , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.draw z, k, c, number$ 
 GR.RENDER
Next angleninea
audio.Stop

Return
eight: 
  GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1
Let number$=number$+"8"    
gr.text.Draw z, k, c, number$
For angleeight = 0 To 270 Step 30
 GR.ROTATE.START angleeight, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angleeight
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For angleeighta = 270 To 0 Step -30
 GR.ROTATE.START angleeighta , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angleeighta
audio.Stop
Return
seven: 
GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1
Let number$=number$+"7"  
gr.text.Draw z, k, c, number$
For angleseven = 0 To 240 Step 30
 GR.ROTATE.START angleseven, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angleseven
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For anglesevena = 240 To 0 Step -30
 GR.ROTATE.START anglesevena , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglesevena 
audio.Stop

Return
six: 
 GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1
Let number$=number$+"6"
gr.text.Draw z, k, c, number$
For anglesix = 0 To 210 Step 30
 GR.ROTATE.START anglesix, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End  
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angle
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For anglesixa = 210 To 0 Step -30
 GR.ROTATE.START anglesixa , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglesixa 
audio.Stop

Return
five: 
GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
      
audio.play aft_1
Let number$=number$+"5"
gr.text.Draw z, k, c, number$
For anglefive = 0 To 180 Step 30
 GR.ROTATE.START anglefive, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglefive
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For anglefivea = 180 To 0 Step -30
 GR.ROTATE.START anglefivea , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglefivea 
audio.Stop
Return
four:   
GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1 
gr.text.Draw z, k, c, number$
 Let number$=number$+"4"
For anglefour = 0 To 150 Step 30
 GR.ROTATE.START anglefour, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglefour
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For anglefoura = 150 To 0 Step -30
 GR.ROTATE.START anglefoura , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglefoura
 audio.Stop
Return
three: 
GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1   
gr.text.Draw z, k, c, number$
Let number$=number$+"3"
For anglethree = 0 To 120 Step 30
 GR.ROTATE.START anglethree, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglethree
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For anglea = 120 To 0 Step -30
 GR.ROTATE.START anglethreea , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End   
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next anglethreea
 audio.Stop
Return
two:
GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1
Let number$=number$+"2"
gr.text.Draw z, k, c, number$
For angletwo = 0 To 90 Step 30
 GR.ROTATE.START angletwo, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End  
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angle
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For angletwoa = 90 To 0 Step -30
 GR.ROTATE.START angletwoa , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angletwoa
 audio.Stop
Return
one: 
GR.Color 255,220, 209, 30, 0
  GR.TEXT.SIZE 26
  
audio.play aft_1 
Let number$=number$+"1"   
gr.text.Draw z, k, c, number$
For angleone = 0 To 60 Step 30
 GR.ROTATE.START angleone, 165,165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End 
 gr.text.Draw z, k, c, number$
 GR.RENDER
Next angleone
pause 100
GR.BITMAP.Draw bd, dial_ptr, x,y
For angleonea = 60 To 0 Step -30
 GR.ROTATE.START angleonea , 165, 165
 GR.BITMAP.Draw bp, roto_ptr, x,y
 GR.ROTATE.End
 gr.text.draw z, k, c, number$
 GR.RENDER
Next angleonea
 audio.Stop
Return