hi, I have tried to replace my basic cube player model for an actual .X file, and I seemed to have really confused myelf in the process.
Here is the code I have done so far.
rem set main game settings
hide mouse
sync on
set display mode 1024,768,32
sync rate 60
set ambient light 80
rem load textures
rem load grass texture
load bitmap "grass02.bmp",1
get image 1,0,0,256,256
delete bitmap 1
rem load stone texture
load bitmap "stone01.bmp",1
get image 2,0,0,256,256
delete bitmap 1
rem load player texture
load bitmap "thug_texture.dds",1
get image 3,0,0,256,256
delete bitmap 1
rem load objects
rem load player object
load object "thug.x",1
delete object 1
rem make landscape
make matrix 1,5000,5000,50,50
update matrix 1
prepare matrix texture 1,1,1,1
rem make maze
rem make outer walls
rem left side
tx#=0
for t=100 to 120
make object cube t,50
texture object t,2
set object texture t,0,1
position object t,tx#,25,0
tx#=tx#+50
next t
rem make player cube
make object 1,"thug.x",3
texture object 2,3
position object 2,100,2,100
position camera 0,2,-20
set object collision on 1
do
rem player variables
x# = object position X(2)
y# = object position Y(2)
z# = object position Z(2)
rem camera variables
cx#= camera position X()
cy#= camera position y()
cz#= camera position z()
rem camera movement
rotate camera camera angle x(0)+(mousemovey()/4.0),camera angle y(0)+(mousemovex()/4.0),0
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
rem player movement
if keystate(17)=1
move object 2,.3
endif
if keystate(31)=1
move object 2,-.3
endif
if keystate(32)=1
move object right 2,.3
endif
if keystate(30)=1
move object left 2,.3
endif
position camera x#, y# , z#
move camera -10
yrotate object 2,camera angle y()
sync
text 0,0, "player x= " + str$(x#)
text 0,15, "player y= " + str$(y#)
text 0,30, "player z= " + str$(z#)
text 0,45, "camera postition = " + str$(cx#) + " " + str$(cy#) + " " + str$(cz#)
loop
rem refresh screen
sync
Any help would be amazing!
Cheers all!
www.the-anarchy.fusiveweb.co.uk