Here is an example i have made. Simple.
Rem Project: SwitchFunction
Rem Created: Thursday, March 03, 2011
Rem Author: MasterManOfJustice
Rem ***** Main Source File *****
`Make some objects that we can select between later
cube=1
square=2
square2=3
selection=4
`Make objects
Make object cube cube,1
Make object box square,1,2,1
Make object box square2,2,1,1
Make object cone selection,1
`Position objects
position object cube,-5,0,5
position object square, 0,0,5
position object square2, 5,0,5
`Make and position matrix
make matrix 1,10,5,4,2
position matrix 1,-5,-.5,2.5
`Position and point the camera
Position Camera 0,10,-10
Point camera 0,1,5
`Make a selection array
Dim Sel(3)
Sel(1) = 0
Sel(2) = 0
Sel(3) = 0
`Set Switches and Starting cycle
Cycle = 1
Spaceswitch=0
Cycleswitch=0
Do
`Instructions
set cursor 0, 0
Print "Press Z to switch selections"
Print "Press Spacebar to start/stop rotations"
`Position the cone to the current object
Position object Selection,object position x(cycle),object position y(cycle)+2,object position z(cycle)
`Rotate the cone, this is just for visual effect
Yrotate object Selection,object angle y(selection)+0.5
`Check and see if the cycle has gone over 3 and if so, reset it to 1
If Cycle > 3
Cycle = 1
Endif
If Keystate(44) = 1 and cycleswitch = 0 //Use Z to increase Cycle
cycle = cycle+1
cycleswitch = 1
Endif
If Keystate(44) = 0 //If Z is let go of, you can press Z again to cycle
cycleswitch = 0
Endif
`Check to see if the object is rotating and start/stop accordingly
For F = 1 to 3
If Sel(F)>1
Sel(F)=0
Endif
If Sel(F)=1
yrotate object F,object angle y(F)+.1
Endif
Next
`Increase the cycle to 1, as shown above, if its already 1, it will go to 0
If spacekey()=1 and spaceswitch = 0
Sel(cycle) = Sel(cycle)+1
spaceswitch = 1
Endif
`If the spacebar is depressed you can press it again to start/stop rotation.
If spacekey()=0
spaceswitch=0
Endif
Loop
