The Tower of Hanoi.
There are three poles one of which contains threaded disks sorted from the biggest one at the bottom to the smallest on at the top. You can take disks from one pole and put them on another one, but you can lift only one disk at a time, and only smaller disk on the top of the bigger.
So, the goal of the Tower of Hanoi game is to remove disks from the central pole and collect them at another empty poles.
Set Display Mode 1024, 768, 32 : Randomize Timer() : Autocam Off : Color Backdrop RGB(0, 0, 0) : Set Text Font "Comic Sans MS" : Set Text Size 30 : Set Text To Bold : Ink RGB(0, 255, 0), Make Vector3(1)+Make Matrix4(2) : Position Camera 0.0, 10.0, 0.0 : Point Camera 0.0, 0.0, 20.0 : Position Light 0, Camera Position X(), Camera Position Y()+10.0, Camera Position Z() : Point Light 0, Camera Position X(), Camera Position Y(), Camera Position Z()+100.0 : Dim Prop(3, 11) : For I=1 To 3 : Make Object Cylinder I, 0.5 : Scale Object I, 80, 2000, 80 : Position Object I, -10.0+((I-1)*10.0), 0.5, 18.0 : Color Object I, Rgb(Rnd(255), Rnd(255), Rnd(255)) : Next I : View Matrix4 2 : r#=Inverse Matrix4(2, 2) : For I=1 To 10 : Make Object Sphere 200+I, 5, 5, 40 : Scale Object 200+I, 15*(I+1), 20, 15*(I+1) : Position Object 200+I, 0.0, 5.0-((I-1)*1.0), 18.0
Prop(2, 11-I)=I : Next I : Color Object 201, RGB(192,192,192) : Color Object 202, RGB(64,0,128) : Color Object 203, RGB(64,0,0) : Color Object 204, RGB(128,0,128) : Color Object 205, RGB(0,0,255) : Color Object 206, RGB(0,255,255) : Color Object 207, RGB(0,255,0) : Color Object 208, RGB(255,255,0) : Color Object 209, RGB(255,128,64) : Color Object 210, RGB(255,0,0) : Prop(2, 11)=10 : Sync Rate 0 : Sync On : Do : If Prop(1, 11)=10 Or Prop(3, 11)=10 : Center Text Screen Width()/2, 50, "Cogratulations!!! Game Complete!!!" : Sync : Wait Key : End : EndIf : Set Vector3 1, 100.0*(-1.0*(1.0-2.0*(MouseX()*1.0)/(Screen Width()*1.0))*0.8), 100.0*((1.0-2.0*(MouseY()*1.0)/(Screen Height()*1.0))*0.6), 100.0 : Transform Coords Vector3 1, 1, 2 : If MouseClick()
If Prop((1+MouseX()/(Screen Width()/3+1)), 11) > 0 And Click=0 : If Intersect Object(Prop((1+MouseX()/(Screen Width()/3+1)), Prop((1+MouseX()/(Screen Width()/3+1)), 11))+200, Camera Position X(), Camera Position Y(), Camera Position Z(), X Vector3(1), Y Vector3(1), Z Vector3(1)) > 0.0 And Click=0 : Obj=Prop((1+MouseX()/(Screen Width()/3+1)), Prop((1+MouseX()/(Screen Width()/3+1)), 11)) : FromPole=(1+MouseX()/(Screen Width()/3+1)) : Click=1 : EndIf : EndIf : EndIf : If Not MouseClick() And Obj > 0 : ToPole=(1+MouseX()/(Screen Width()/3+1)) : If ToPole <> FromPole And (Prop(ToPole, Prop(ToPole, 11)) > Obj Or Prop(ToPole, Prop(ToPole, 11))=0) : Prop(ToPole, 11)=Prop(ToPole, 11)+1 : Prop(ToPole, Prop(ToPole, 11))=Obj : Prop(FromPole, 11)=Prop(FromPole, 11)-1 : Position Object Obj+200, Object Position X(ToPole), -5.0+Prop(ToPole, 11)*1.0, Object Position Z(ToPole) : Inc Steps : Else : Position Object Obj+200, Object Position X(FromPole), -5.0+Prop(FromPole, 11)*1.0, Object Position Z(FromPole) : Center Text Screen Width()/2, 50, "Ops..." : EndIf : Click=0 : Obj=0 : EndIf : If Obj > 0 : Position Object 200+Obj, Camera Position X()+X Vector3(1)/(Z Vector3(1)/18.0), Camera Position Y()+Y Vector3(1)/(Z Vector3(1)/18.0)-2.0, Camera Position Z()+Z Vector3(1)/(Z Vector3(1)/18.0)
EndIf : Text 10, 10, "The Tower Of Hanoi by DMiTR0S"+Chr$(10)+"Steps: "+Str$(Steps) : Sync : Loop : UnDim Prop() :
Easy to understand version.
Rem The Tower Of Hanoi by DMiTR0S
Set Display Mode 1024, 768, 32
Randomize Timer()
Autocam Off
Color Backdrop RGB(0, 0, 0)
Set Text Font "Comic Sans MS"
Set Text Size 30
Set Text To Bold
Ink RGB(0, 255, 0), Make Vector3(1)+Make Matrix4(2)
Position Camera 0.0, 10.0, 0.0
Point Camera 0.0, 0.0, 20.0
Position Light 0, Camera Position X(), Camera Position Y()+10.0, Camera Position Z()
Point Light 0, Camera Position X(), Camera Position Y(), Camera Position Z()+100.0
Dim Prop(3, 11)
For I=1 To 3
Make Object Cylinder I, 0.5
Scale Object I, 80, 2000, 80
Position Object I, -10.0+((I-1)*10.0), 0.5, 18.0
Color Object I, Rgb(Rnd(255), Rnd(255), Rnd(255))
Next I
View Matrix4 2
r#=Inverse Matrix4(2, 2)
For I=1 To 10
Make Object Sphere 200+I, 5, 5, 40
Scale Object 200+I, 15*(I+1), 20, 15*(I+1)
Position Object 200+I, 0.0, 5.0-((I-1)*1.0), 18.0
Prop(2, 11-I)=I
Next I
Color Object 201, RGB(192,192,192)
Color Object 202, RGB(64,0,128)
Color Object 203, RGB(64,0,0)
Color Object 204, RGB(128,0,128)
Color Object 205, RGB(0,0,255)
Color Object 206, RGB(0,255,255)
Color Object 207, RGB(0,255,0)
Color Object 208, RGB(255,255,0)
Color Object 209, RGB(255,128,64)
Color Object 210, RGB(255,0,0)
Prop(2, 11)=10
Sync Rate 0
Sync On
Do
If Prop(1, 11)=10 Or Prop(3, 11)=10
Center Text Screen Width()/2, 50, "Congratulations!!! Game Complete!!!"
Sync
Wait Key
End
EndIf
Set Vector3 1, 100.0*(-1.0*(1.0-2.0*(MouseX()*1.0)/(Screen Width()*1.0))*0.8), 100.0*((1.0-2.0*(MouseY()*1.0)/(Screen Height()*1.0))*0.6), 100.0
Transform Coords Vector3 1, 1, 2
If MouseClick()
If Prop((1+MouseX()/(Screen Width()/3+1)), 11) > 0 And Click=0
If Intersect Object(Prop((1+MouseX()/(Screen Width()/3+1)), Prop((1+MouseX()/(Screen Width()/3+1)), 11))+200, Camera Position X(), Camera Position Y(), Camera Position Z(), X Vector3(1), Y Vector3(1), Z Vector3(1)) > 0.0 And Click=0
Obj=Prop((1+MouseX()/(Screen Width()/3+1)), Prop((1+MouseX()/(Screen Width()/3+1)), 11))
FromPole=(1+MouseX()/(Screen Width()/3+1))
Click=1
EndIf
EndIf
EndIf
If Not MouseClick() And Obj > 0
ToPole=(1+MouseX()/(Screen Width()/3+1))
If ToPole <> FromPole And (Prop(ToPole, Prop(ToPole, 11)) > Obj Or Prop(ToPole, Prop(ToPole, 11))=0)
Prop(ToPole, 11)=Prop(ToPole, 11)+1
Prop(ToPole, Prop(ToPole, 11))=Obj
Prop(FromPole, 11)=Prop(FromPole, 11)-1
Position Object Obj+200, Object Position X(ToPole), -5.0+Prop(ToPole, 11)*1.0, Object Position Z(ToPole)
Inc Steps
Else
Position Object Obj+200, Object Position X(FromPole), -5.0+Prop(FromPole, 11)*1.0, Object Position Z(FromPole)
Center Text Screen Width()/2, 50, "Ops..."
EndIf
Click=0
Obj=0
EndIf
If Obj > 0
Position Object 200+Obj, Camera Position X()+X Vector3(1)/(Z Vector3(1)/18.0), Camera Position Y()+Y Vector3(1)/(Z Vector3(1)/18.0)-2.0, Camera Position Z()+Z Vector3(1)/(Z Vector3(1)/18.0)
EndIf
Text 10, 10, "The Tower Of Hanoi by DMiTR0S"+Chr$(10)+"Steps: "+Str$(Steps)
Sync
Loop
UnDim Prop()
DBPro only.