ok so here goes..........
this bit i changed to allow sidestepping instead of using the left\right arrowkeys to rotate (as this is done by mouse now)
remstart
`rotate right left
if leftkey()=1 then yrotate object Hero,ay1#-1
`rotate hero right
if rightkey()=1 then yrotate object Hero,ay1#+1
remend
`***** changed to allow side stepping
if leftkey() then move object left hero,1
if rightkey() then move object right hero,1
this bit is the code u wanted (i.e. rotating using mouse and crosshair)
`***** code added here *****
`will look around with the mouse
ax1#=object angle x(hero)
mx=mousemovex()
my=mousemovey()
if mx<0 then yrotate object hero,ay1#-1
if mx>0 then yrotate object hero,ay1#+1
if my<0 then xrotate object hero,ax1#-0.25
if my>0 then xrotate object hero,ax1#+0.25
`sets up a crosshair
line screen width()/2-20,screen height()/2,screen width()/2+20,screen height()/2
line screen width()/2,screen height()/2-10,screen width()/2,screen height()/2+10
ellipse screen width()/2,screen height()/2,20,10
and the full code is here
sync on
sync rate 60
set display mode 1024,768,32
World=1
Size=10000
Segments=10
make matrix World,Size,Size,Segments,Segments
randomize matrix World,100
update matrix World
hero=1
make object cube hero,10
position object Hero,rnd(20),1,rnd(20)
`SET UP VARIABLES FOR HERO SPEED
`speed for hero
speed#=0.0
`acceleration speed
acceleration#=.03
`max speed hero can move at
MaxSpeed=6.0
`min speedhero can move at
MinSpeed=-2.0
`slowly move charector speed down when not moving
Friction#=.03
`MAIN LOOP
do
`Here are our variables for the Hero. These are just position values
x1#=object position x(Hero)
z1#=object position z(Hero)
y1#=get ground height(World,x1#,z1#)
ay1#=object angle y(Hero)
`stay on matrix
if x1#>Size then x1#=x1#-1
if x1#<0 then x1#=0
if z1#>Size then z1#=z1#-1
if z1#<0 then z1#=0
`camera follow hero
set camera to follow x1#,y1#,z1#,ay1#,50,30,1,1
position object Hero,x1#,y1#,z1#
set camera to object orientation hero
`if up arrow hit then increase hero speed
if upkey()=1 then INC speed#,acceleration#
`down arrow decrease hero speed
if downkey()=1 then DEC speed#,acceleration#
remstart
`rotate right left
if leftkey()=1 then yrotate object Hero,ay1#-1
`rotate hero right
if rightkey()=1 then yrotate object Hero,ay1#+1
remend
`***** changed to allow side stepping
if leftkey() then move object left hero,1
if rightkey() then move object right hero,1
`cap the speed off
if speed#>MaxSpeed then speed#=MaxSpeed
`cap the speed off
if speed#<MinSpeed then speed#=MinSpeed
`move the hero
move object Hero,speed#
if upkey()=0 and downkey()=0
`if moving forward and not hitting up or down arrows, decrease speed
if speed#>=0.0
DEC speed#,Friction#
endif
`if moving backwards and not hitting up or down arrows, increase speed
if speed#<=0.0
INC speed#,Friction#
endif
endif
set cursor 0,0
`display hero variables for viewing
print "X Position "; x1#
print "Z Position ";z1#
print "Y Position ";y1#
print "Speed ";speed#
`***** code added here *****
`will look around with the mouse
ax1#=object angle x(hero)
mx=mousemovex()
my=mousemovey()
if mx<0 then yrotate object hero,ay1#-1
if mx>0 then yrotate object hero,ay1#+1
if my<0 then xrotate object hero,ax1#-0.25
if my>0 then xrotate object hero,ax1#+0.25
`sets up a crosshair
line screen width()/2-20,screen height()/2,screen width()/2+20,screen height()/2
line screen width()/2,screen height()/2-10,screen width()/2,screen height()/2+10
ellipse screen width()/2,screen height()/2,20,10
sync
loop
good luck with the game
life's one big game
spec= 2.6ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic