Quote: "load the object (the cylinder) and then lock it to the screen
"
lock object isnt the best way to do it i had a big convo with zotoaster a couple of months back about this Subject
this is the thread.
but the code u may be interested in is
`Standard Setup
Sync on : Sync rate 60
Set display mode 1024,768,16 : Hide mouse
Autocam off : set camera range 1,99999999999
`Player data
id=1
speed#=4.0
traction#=0.93
jump#=30.0
sense#=2.0
smooth#=10.0
bobspeed#=6.0
bobwidth#=0.2
bobheight#=0.1
offsetx#=1.0
offsety#=-1.5
`Create Player
make object plain id,10,10
hide object id
make mesh from object id,id
add limb id,id,id
delete mesh id
make object box id+1,.7,.7,8
glue object to limb id+1,id,id
`Create world
make matrix 1,3000,3000,50,50
`**Main Loop**
Do
`*Controls*
agy#=curveangle(agy#+(mousemovex()/sense#),object angle y(id),smooth#/2.0)
agx#=curveangle(agx#+(mousemovey()/sense#),object angle x(id),smooth#/2.0)
rgax#=wrapvalue(agx#+180)
ax#=curveangle(agx#,ax#,smooth#)
ay#=curveangle(agy#,ay#,smooth#)
if keystate(17)=1
xspeed#=sin(ay#)*speed#
zspeed#=cos(ay#)*speed#
ofx#=wrapvalue(ofx#+bobspeed#)
ofy#=wrapvalue(ofy#+bobspeed#)
endif
if keystate(31)=1
xspeed#=-sin(ay#)*speed#
zspeed#=-cos(ay#)*speed#
ofx#=wrapvalue(ofx#+bobspeed#)
ofy#=wrapvalue(ofy#+bobspeed#)
endif
if keystate(30)=1
xspeed#=sin(wrapvalue(ay#-90))*speed#
zspeed#=cos(wrapvalue(ay#-90))*speed#
ofx#=wrapvalue(ofx#+bobspeed#)
ofy#=wrapvalue(ofy#+bobspeed#)
endif
if keystate(32)=1
xspeed#=sin(wrapvalue(ay#+90))*speed#
zspeed#=cos(wrapvalue(ay#+90))*speed#
ofx#=wrapvalue(ofx#+bobspeed#)
ofy#=wrapvalue(ofy#+bobspeed#)
endif
if keystate(17)=0 and keystate(30)=0 and keystate(31)=0 and keystate(32)=0 then ofx#=0 : ofy#=0
xspeed#=xspeed#*traction#
zspeed#=zspeed#*traction#
x#=x#+xspeed#
y#=y#+yspeed#
z#=z#+zspeed#
y#=10.0
rotate camera ax#,ay#,0
position camera x#,y#,z#
position object id,x#,y#,z#
rotate object id,agx#,agy#,0
bobx#=curvevalue(offsetx#+(sin(ofx#)*bobwidth#),limb offset x(id,id),smooth#)
boby#=curvevalue(offsety#+(abs(cos(ofy#))*bobheight#),limb offset y(id,id),smooth#)
offset limb id,id,bobx#,boby#,0
`**End Loop**
Sync
Loop
ask if you need anything cleared up
BM
Our aim is to keep the loo's clean, your aim can help.
3.0ghz pentium dual core processor, 2gb ds ram, 250gb HD