Here you go. I've kept it simple so you can follow what's going on.
Set Display Mode 800,600,32
Sync On
Sync Rate 0
AutoCam Off
Make Matrix 1,1000,1000,50,50
Position Camera 500,40,440
Point Camera 500,0,500
Do
I$=Inkey$(): Key=ASC(I$)-48
If Key>0 And Key<6 Then Gosub LoadLevel
Sync
Center Text 400,0,"Press Keys 1 To 5 To Load Levels 1 To 5"
Loop
End
LoadLevel:
For N=1 TO 99
If Object Exist(N) Then Delete Object N
Next N
FName$="Level"+Str$(Key)+".lvl"
Open To Read 1,FName$
Read String 1,T$: NumObjects=VAL(T$): Rem Number Of Objects In This Level
For N=1 To NumObjects: Rem Loop To Read Data For Each Object
Read String 1,T$: ObjType=VAL(T$): Rem Object Type - Eg: 0=Box 1=Sphere 2=Loaded .X File And So On
Select ObjType
Case 0: Rem Object Type Box
Read String 1,T$: ObjWidth=VAL(T$)
Read String 1,T$: ObjHeight=VAL(T$)
Read String 1,T$: ObjDepth=VAL(T$)
Make Object Box N,ObjWidth,ObjHeight,ObjDepth
Read String 1,T$: R=VAL(T$)
Read String 1,T$: G=VAL(T$)
Read String 1,T$: B=VAL(T$)
Color Object N,RGB(R,G,B)
Read String 1,T$: ObjAngX#=VAL(T$)
Read String 1,T$: ObjAngY#=VAL(T$)
Read String 1,T$: ObjAngZ#=VAL(T$)
Rotate Object N,ObjAngX#,ObjAngY#,ObjAngZ#
Read String 1,T$: ObjPosX#=VAL(T$)
Read String 1,T$: ObjPosY#=VAL(T$)
Read String 1,T$: ObjPosZ#=VAL(T$)
Position Object N,ObjPosX#,ObjPosY#,ObjPosZ#
EndCase
Case 1: Rem Object Type Sphere
Read String 1,T$: ObjRadius=VAL(T$)
Make Object Sphere N,ObjRadius
Read String 1,T$: R=VAL(T$)
Read String 1,T$: G=VAL(T$)
Read String 1,T$: B=VAL(T$)
Color Object N,RGB(R,G,B)
Read String 1,T$: ObjAngX#=VAL(T$)
Read String 1,T$: ObjAngY#=VAL(T$)
Read String 1,T$: ObjAngZ#=VAL(T$)
Rotate Object N,ObjAngX#,ObjAngY#,ObjAngZ#
Read String 1,T$: ObjPosX#=VAL(T$)
Read String 1,T$: ObjPosY#=VAL(T$)
Read String 1,T$: ObjPosZ#=VAL(T$)
Position Object N,ObjPosX#,ObjPosY#,ObjPosZ#
EndCase
Case 2: Rem Object Type .X
Read String 1,Filename$
Read String 1,T$: ObjAngX#=VAL(T$)
Read String 1,T$: ObjAngY#=VAL(T$)
Read String 1,T$: ObjAngZ#=VAL(T$)
Rotate Object N,ObjAngX#,ObjAngY#,ObjAngZ#
Read String 1,T$: ObjPosX#=VAL(T$)
Read String 1,T$: ObjPosY#=VAL(T$)
Read String 1,T$: ObjPosZ#=VAL(T$)
Position Object N,ObjPosX#,ObjPosY#,ObjPosZ#
EndCase
EndSelect
Next N
Close File 1
Return
Save the code snippet and the levels in the attachment into the same folder.
Run the snippet and press the number keys 1 to 5 to load the 'levels'.
If you look at the level files you will see I've commented the data for the first couple of objects. You can have as many objects in a level - just alter the first value so it matches with the number in the file.
You can also add data to the format - for example you might need an object scale value. Just alter the level loading procedure to match the data to load in.
I've not added a .X loading section but you can see how it would be implemented.
Feel free to alter the data values in the .lvl files to alter the 'levels'. And, you don't need the comments when you have the file how you want it - the program only reads in the values.
Finally, you might find it easier writing a utility which lets you place the objects with the mouse then creates the .lvl file rather than creating them manually.
Good luck!
TDK_Man