Hi, here's my code
Rem Project: weapontest
Rem Created: Sunday, May 24, 2009
Rem ***** Main Source File *****
Sync On : Sync Rate 0 : set display mode 1280, 800, 32
set window off
Do
if Button(20,55,"New Game")=1 then Goto New_Game
Button(20,95,"Load Game")
If Button(20,135,"Exit")=1 then End
sync
loop
New_Game:
sync
hide mouse
load object "media\Template Body 2.x", 1
make memblock 1,100
position object 1, 15, 15, 15
scale object 1, 30, 30, 30
xpos#=object position x(1)
ypos#=object position y(1)
zpos#=object position z(1)
load object "media\Template Body 1.x", 7
position object 7,30, 1, 50
scale object 1, 40, 40, 40
load object "media\house.3ds", 2
load object "media\house.3ds", 3
position object 3, 50, 1, 30
get image 5, 0, 0, 50, 50
get image 6, 0, 0, 50, 50
load image "media\tmp27.jpg", 5
load image "media\tmp27.jpg", 6
texture object 2, 5
position object 2,0,1, 140
scale object 2, -2000, -2000, -2000
rotate object 2, 0,0,180
make matrix 1,800,800,5,5
Position Matrix 1,-100,0,-100
prepare matrix texture 1, 5, 5, 5
SC_setupcomplexobject 1, 0, 2
SC_setupobject 2, 0, 0
SC_SetObjectCollisionOn 1
load object "media\simple shelf.x", 13
scale object 13, 400, 400, 400
rotate object 13, 90, 0, 0
position object 13, 15, 1, 193
load object "media\orange.x", 15
movespeed = 75
turnspeed = 87.5
time=timer()
Ang# = 270
CamYPos# = 130
Do
gameTime=timer()-time
MSframe#=gameTime*(movespeed/1000.0)
TSframe#=gameTime*(turnspeed/1000.0)
oldx#=object position x(1)
oldy#=object position y(1)
oldz#=object position z(1)
If Upkey()=1
Move Object 1,MSframe#
endif
If Downkey()=1
Move Object 1,-MSframe#
endif
If Leftkey()=1
Dec a#,TSframe#
endif
If Rightkey()=1
Inc a#,TSframe#
endif
yrotate object 1,a#
posy#=object position y(1)
posx#=cos(Ang#-a#) * 90 + object position x(1)
posz#=sin(Ang#-a#) * 90 + object position z(1)
Position Camera posx#,object position y(1)+CamYPos#,posz#
Point Camera object position x(1),object position y(1),object position z(1)
inc CamDist#, MouseMoveZ()/5
if CamDist# < 0 then CamDist# = 0
if CamDist# > 100 then CamDist# = 100
move camera CamDist#
if MouseClick()=4
CamYPosOld# = CamYPos#
dec CamYPos#, MouseMoveY()/5
if CamYPos# < 0 or CamYPos# > 200
CamYPos# = CamYPosOld#
endif
endif
Ang# = Wrapvalue(Ang#)
time=timer()
set cursor 0,0
print mousemovey()
print mousemovex()
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
sync
Loop
end
function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
endif
endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
Now how do I make it so all of them collide naturally, I could only find help for boxes or spheres in the tutorials.
My site: www.skyknight.co.uk