Way to go Dude!
I can see by your comments:
Quote: "...SUCCESS!!!!! "
that you are discovering the fun of programming. You seem to be enjoying working your way through the "puzzle". It's just the way you would play a game. So I don't know if you want any "cheats". But if the going gets too frustrating try:
` All game elements except the most basic are removed.
` Get rid of the clutter to zero in on the problem
` Where original code was changed, the original is commented out
` and the new line placed underneath.
` Some completely new lines are added and some old lines repositioned.
` These changes can be found by comparison with the old file.
` I'd say your collision problem is solved.
` The rest is up to you.
` How about a little code to: Take out the bunker and secure the hill.
` Regards, Hop A Long
sync on
autocam off
hide mouse
`set global collision on
make matrix 2,2000,2000,1,1
`load image "water0001.jpg",2
`prepare matrix texture 2,2,1,1
`ghost matrix on 2
`load object "bunker.3ds",1
`load image "bunker.bmp",1
`texture object 1,1
`position object 1,445,15,557
`bunker1=0
`load object "bunker.3ds",2
`load image "bunker1.bmp",4
`texture object 2,4
` Substitute a box for bunker 2
` Use the collision box data to guess the size.
Make Object Box 2,100,100,100
`position object 2,910,18,1007
` Set the box on the matrix
position object 2,910,50,1007
`rotate object 2,0,178,0
make object collision box 2,-50,-50,-50,50,50,50,0
`bunker=1
`load image "grass.bmp",1
`load object "land.3ds",8
`texture object 8,1
`scale object 8,500,500,500
`position object 8,671,15,760
` Don't need these with a following camera
`position camera 134,28,75
`rotate camera 14,297,0
`load object "sky07.3ds",4
`scale object 4,12000,15000,14000
`position object 4,674,0,759
`set object 4,1,0,1
`load image "dirt.bmp",6
`make object plain 6,3000,3000
`texture object 6,6
`position object 6,1018,-57,803
`rotate object 6,90,0,0
fog on
red= rgb(255,57,0)
fog color red
fog distance 3000
`load object "cat.3ds",7
` Substitute a box for the cat.
` Use the collision box dimensions to guess the size
Make Object Box 7,20,20,20
`position object 7,539,40,472
` Position the box on the matrix
position object 7,539,10,472
`rotate object 7,0,270,0
` Let's face the bunker
rotate object 7,0,180,0
make object collision box 7,-10,-10,-10,10,10,10,0
` Remove this sync
`sync
do
`camdist#=25 : camhigh#=posy#+10.0 : camfade#=3.5
` Too close to the cat
camdist#=100: camhigh#=posy#+20.0 : camfade#=3.5
set camera to follow posx#,posy#,posz#,angle#+180,camdist#,camhigh#,camfade#,1
`if upkey()=1 then move object 7,-2
`if downkey()=1 then move object 7,2
` Let's get there quickly
if upkey()=1 then move object 7,-4
if downkey()=1 then move object 7,4
`if leftkey()=1 then yrotate object 7,wrapvalue(angle#-5)
`if rightkey()=1 then yrotate object 7,wrapvalue(angle#+5)
` Easy on the turns
if leftkey()=1 then yrotate object 7,wrapvalue(angle#-2)
if rightkey()=1 then yrotate object 7,wrapvalue(angle#+2)
posx#=object position x(7)
posy#=object position y(7)
posz#=object position z(7)
angle#=object angle y(7)
position object 7,posx#,posy#,posz#
obj_id = 0
` Detect collision with an Object and Slide
If Object Collision(7,0)>0
` Obtain the object id for our text print out
obj_id = Object Collision(7,0)
` Decrement the Player coordinates to begin the slide
` You would need y if crossing a bridge, applying gravity etc.
` The Get Object Collision command only returns a value when a non-rotating
` collision box is used.
Dec posx#,get object collision x()
Dec posy#,get object collision y()
Dec posz#,get object collision z()
Endif
` Add this line to make use of the collision data
Position Object 7,posx#,posy#,posz#
Text 10,400, "The cat hits object number: "+str$(obj_id)
Center Text 320,20, "SABERDUDE'S COLLISION DEMO"
sync
loop