hide mouse
  AutoCam Off
  Sync On
  Sync Rate 30
  CLS 0
  Dim DScore(2)
  Randomize Timer()
  True = 1: False = 0
gosub images
Gosub Setup
 
f#=50
 
 
repeat
  xrotate object 1,wrapvalue(object angle x(1)-11)
  xrotate object 2,wrapvalue(object angle x(2)+12)
  Position Object 1,0.6,f#,0
  Position Object 2,-0.6,f#,0
  point camera 0,f#,0
  f#=f#-0.4
  Sync
until f#<0
wait 500
for t=0 to 4
position object 1,t,0,0
position object 2,t,0,0
position object 3,t,0,0
sync
next t
for t=4 to -4 step -1
position object 1,t,0,0
position object 2,t,0,0
position object 3,t,0,0
sync
next t
for t=-4 to 0 
position object 1,t,0,0
position object 2,t,0,0
position object 3,t,0,0
sync
next t
wait 500
 
for t=0 to 120
zrotate object 3,t
position object 1,tp#,0,0
position object 2,tp#,0,0
position object 3,tp#,0,0
inc tp#,0.02
sync
next t
gggg:
rotate object 1,0,0,0
rotate object 2,0,0,0
For N=1 To 2
        DScore(N)=Rnd(5)+1: Rem Random dice face chosen
        Select DScore(N)
          Case 1: Rotate Object N,0,90,0: EndCase
          Case 2: Rotate Object N,0,180,0: EndCase
          Case 3: Rotate Object N,90,0,0: EndCase
          Case 4: Rotate Object N,270,0,0: EndCase
          Case 5: Rotate Object N,0,0,0: EndCase
          Case 6: Rotate Object N,0,270,0: EndCase
        EndSelect
      Next N
        DScore1=DScore(1)
        DScore2=DScore(2)
 
 
position object 1,-1,0,0
position object 2,0,0,0
 
c#=1
dh#=1
for t=0 to 40
dec c#,0.1
position object 1,c#-1,dh#,0
position object 2,c#,dh#,0
dec dh#,0.1
sync
next t
 
 
ink rgb(255,255,255),0
repeat
set cursor 0,0
print "You got ",DScore1," and ",DScore2,". Please press space."
sync
until spacekey()=1
 
End
 
 
 
 
 
images:
ink rgb(255,0,0),0
box 0,0,300,300
ink rgb(190,0,0),0
for t=0 to 9000
a=rnd(300)
b=rnd(300)
box a,b,a,b
next t
get image 1,0,0,300,300
cls
ink rgb(0,120,0),0
box 0,0,300,300
ink rgb(0,150,20),0
for t=0 to 6000
a=rnd(300)
b=rnd(300)
box a,b,a,b
next t
get image 2,0,0,300,300
cls
ink rgb(255,255,255),0
for t=0 to 2000
a=rnd(500)
b=rnd(400)
box a,b,a,b
next t
get image 3,0,0,500,400
cls
return
 
 
 
 
Setup:
 
  MakeDice(2,1,1.0)
  Position Object 1,0.6,3,0
  Position Object 2,-0.6,3,0
  Position Camera 0,0,-10
  make object cylinder 3,5
  texture object 3,1
  make object box 4,500,4,500
  position object 4,0,-6.5,0
  texture object 4,2
  make object sphere 5,5000
  texture object 5,3 
  set object 5,1,1,0
Return
 
 
 
 
 
Function MakeDice(NumDice,StartObjNumber,DiceSize#)
  Create Bitmap 1,800,600
  CLS RGB(85,0,0)
  Rem Number One
  Ink RGB(255,255,255),0: Box 2,2,254,254
  Ink RGB(0,0,0),0
  For N=1 To 24
    Circle 128,128,N: Circle 128,129,N
  Next N
  Get Image 1001,0,0,256,256
  Rem Number Two
  Ink RGB(255,255,255),0: Box 2,2,254,254
  Ink RGB(0,0,0),0
  For N=1 To 24
    Circle 46,46,N: Circle 46,47,N
    Circle 208,208,N: Circle 208,209,N
  Next N
  Get Image 1002,0,0,256,256
  Rem Number Three
  Ink RGB(255,255,255),0: Box 2,2,254,254
  Ink RGB(0,0,0),0
  For N=1 To 24
    Circle 46,46,N: Circle 46,47,N
    Circle 128,128,N: Circle 128,129,N
    Circle 208,208,N: Circle 208,209,N
  Next N
  Get Image 1003,0,0,256,256
  Rem Number Four
  Ink RGB(255,255,255),0: Box 2,2,254,254
  Ink RGB(0,0,0),0
  For N=1 To 24
    Circle 46,46,N: Circle 46,47,N
    Circle 208,46,N: Circle 208,47,N
    Circle 46,208,N: Circle 46,209,N
    Circle 208,208,N: Circle 208,209,N
  Next N
  Get Image 1004,0,0,256,256
  Rem Number Five
  Ink RGB(255,255,255),0: Box 2,2,254,254
  Ink RGB(0,0,0),0
  For N=1 To 24
    Circle 46,46,N: Circle 46,47,N
    Circle 208,46,N: Circle 208,47,N
    Circle 128,128,N: Circle 128,129,N
    Circle 46,208,N: Circle 46,209,N
    Circle 208,208,N: Circle 208,209,N
  Next N
  Get Image 1005,0,0,256,256
  Rem Number Six
  Ink RGB(200,200,255),0: Box 2,2,254,254
  Ink RGB(0,0,0),0
  For N=1 To 24
    Circle 46,46,N: Circle 46,47,N
    Circle 208,46,N: Circle 208,47,N
    Circle 46,128,N: Circle 46,129,N
    Circle 208,128,N: Circle 208,129,N
    Circle 46,208,N: Circle 46,209,N
    Circle 208,208,N: Circle 208,209,N
  Next N
  Get Image 1006,0,0,256,256
  Set Current Bitmap 0
  Delete Bitmap 1
  For ObjNum = StartObjNumber To StartObjNumber+(NumDice-1)
    Offset#=DiceSize#/2.0: MeshNum=2000: PlainNum=2000
    Make Object Cube ObjNum,DiceSize#
    Make Object Plain PlainNum,DiceSize#,DiceSize#
    Make Mesh From Object MeshNum,PlainNum
    ADD LIMB ObjNum,1,2000: Offset Limb ObjNum,1,0,0,0.0-Offset#: Rem Cube Side 1 (Front)
    ADD LIMB ObjNum,2,2000: Rotate Limb ObjNum,2,0,90,0: Offset Limb ObjNum,2,0.0-Offset#,0,0: Rem Cube Side 2 (Left)
    ADD LIMB ObjNum,3,2000: Rotate Limb ObjNum,3,0,180,0: Offset Limb ObjNum,3,0,0,Offset#:  Rem Cube Side 3 (Back)
    ADD LIMB ObjNum,4,2000: Rotate Limb ObjNum,4,0,270,0: Offset Limb ObjNum,4,Offset#,0,0:  Rem Cube Side 4 (Right)
    ADD LIMB ObjNum,5,2000: Rotate Limb ObjNum,5,270,0,0: Offset Limb ObjNum,5,0,0.0-Offset#,0: Rem Cube Side 5 (Bottom)
    ADD LIMB ObjNum,6,2000: Rotate Limb ObjNum,6,90,0,0: Offset Limb ObjNum,6,0,Offset#,0: Rem Cube Side 6 (Top)
    Delete Mesh MeshNum
    Delete Object PlainNum
    Hide Limb ObjNum,0
    Texture LIMB ObjNum,1,1005: Texture LIMB ObjNum,2,1006
    Texture LIMB ObjNum,3,1002: Texture LIMB ObjNum,4,1001
    Texture LIMB ObjNum,5,1003: Texture LIMB ObjNum,6,1004
  Next ObjNum
EndFunction