Me again
,
I have this code so far -
Rem ***** Main Source File *****
`Misc
Hide Mouse
Color backdrop RGB(0,0,0)
set ambient light 90
set display mode 1024,768,32
AUTOCAM OFF
`Setup matrix
Make matrix 1,10000,10000,50,50
Load Image "da.jpg",1
prepare matrix texture 1,1,2,2
`Make The object
Make object sphere 1,50
Color object 1,RGB(255,0,0)
Position object 1,5000,25,5000
objspeed#=2
`make the wall
Make object cube 2,100
scale object 2,100,200,100
position object 2,5000,100,7000
`main loop (controls camera+movement)
DO
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
if mouseclick()=1 then
yrotate object 1, object angle y(1)+2
if mouseclick()=2 then
yrotate object 1, object angle y(1)-2
if upkey()=1 then move object 1,10
if upkey()=0 then move object 1,-2
if returnkey()=1 then position object 1,5000,25,5000
Set camera to follow x#,y#,z#,0,0,1000,10.0,0
rotate camera 90,0,0
if x#>4950 and x#<5100 and z#>6950 and z#<7100
END
endif
LOOP
What I would like to be able to do is control where the ball moves (left or right) with the mouse. So when the mouse is moved left, the sphere will move left and vice versa with right.
Also if there are any better ways of doing the small bit of collision I have attempted or anything I could do to improve the code.
Thanks in advanced.