sync on:sync rate 60
rem different every time
randomize timer()
rem the scene
for i=1 to 300
make object box i,rnd(4)+1,rnd(15)+1,rnd(4)+1
color object i,rgb(rnd(255),rnd(255),rnd(255))
position object i,(rnd(10000))/100.0,0,(rnd(10000))/100.0
next i
rem the floor
make object plain 1010,200,200
color object 1010,rgb(255,255,255)
pitch object down 1010,90
rem the camera
position camera -5,0.5,-5
point camera 1,0.5,1
set camera range 0.1,1000
rem fill light
make light 1
set point light 1,120,10,120
color light 1,rgb(85,20,20)
do
rem simple rotation if spacekey is not pressed
if leftkey() and (spacekey()=0) then turn camera left 1
if rightkey() and (spacekey()=0) then turn camera right 1
rem strafe
if leftkey() and spacekey()
turn camera left 90
move camera 0.1
turn camera right 90
endif
if rightkey() and spacekey()
turn camera right 90
move camera 0.1
turn camera left 90
endif
rem walk
if upkey() then move camera 0.1
if downkey() then move camera -0.1
text 30,30,"Press SPACE and LEFT/RIGHT to strafe"
sync
loop
this is a simple example, to strafe the code checks for the strafe key and then turns the camera in the required direction 90deg, then moves it forwards, then faces the camera forward again and then runs the rest of the code to walk etc, so all the player sees is the final position of the camera after rotation, walking and straffing have been applied to the camera, since you don`t see what the camera is seeing until the sync, cheers.
Mentor.
OOPS! had to edit since I wrote it in pro, should work though, I removed pro commands.
PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.