hmm after many more attempts I have managed to get part of the code working with some(lots) adjustments here and there, all wrong probably but really DBP was being a pain in the botty, I will leave the source here and comment on what was changed for you(hope you can understand it). the matrix stuff stopped it from running though and I presume is something to do with the Direct 3D but I am not sure. hope this helps a little further.
Rem Project: SideScroller
Rem Created: 9/19/2002 7:39:26 PM
Rem ***** Main Source File *****
gosub _prep_world
gosub _prep_character
gosub _prep_items
gosub _prep_enemies
sync on
sync rate 0
do
gosub _handle_player
sync
loop
_prep_world:
` OK here I changed this because of erors coming at me
`about the image, so I thought this the best solution for
`now.
load bitmap "ground\ground.bmp",1
Get Image 1,0,0,bitmap width(1),bitmap height(1)
Delete Bitmap 1
` Here I got Matrix already in use.. so had to use number 2
` for the matrix number
make matrix 2,3000,1500,15,15
prepare matrix texture 2,1,1,1
position matrix 2,-750,-300,0
` I took this chunk out to get a quick test in, and I think
` there is something here to do with the first error I
` reported, but I am not too sure on this.
Remstart
tr#=50
for x=0 to 15
set matrix height 1,x,0,0
for z=1 to 14
h#=cos((z-7)*20)*100.0
h#=h#+tr#
if x<13 then h#=250.0
n#=0.25+(rnd(10)*0.75)
n#=n#*cos((z-8)*20)
set matrix height 1,x,z,h#
set matrix normal 1,x,z,n#,n#,n#
next z
set matrix height 1,x,14,0
tr#=tr#+(rnd(50)-25)
next x
update matrix 1
delete image 1
return
remend
_prep_character:
` Here I got an object already exists command so had to
` delete it before making it.. probably something to do
` with the fact it does not delete objects after an
` unsuccessful run of the exe or something..
` again I cannot be sure, but it sounds a reasonable answer
If object exist(1) then Delete object 1
make object cube 1,10
position object 1,-740,-200,0
m=get ground height(2,object position x(1),object position z(1))
position object 1,-750,m,0
` Here the make camera command reported camera already
` Made, there is no Camera Exist command to delete it
` before making it so had to use the defualt camera present
position camera object position x(1),object position y(1),-100
return
_prep_items:
return
_prep_enemies:
return
_handle_player:
px=object position x(1)
py=object position y(1)
pz=object position z(1)
` More changes because of the errors flying around, does
` the same thing I think!! but check it to see if correct.
if upkey()=1
position object 1,px,object position y(1)+10,pz
endif
m=get ground height(2,px,pz)
` Again more errors required more fixes... and I think this
` does as you wanted.. you can judge that.
if upkey()=0
` I added this> "py=py-15" to drop the object smotther than before
` the previous code made the ground flicker on screen..
` you'l have to trust me on this one.
py=py-15
If py<=m then py=m
Position object 1,px,py,pz
endif
` Again more changes to the way the player is repositioned
if leftkey()=1 then Position Object 1,Object Position x(1)-1,py,pz
if object Position x(1)<=0 then Position Object 1,1,py,pz
if rightkey()=1 then Position Object 1,Object Position x(1)+1,py,pz
point camera object position x(1),object position y(1),0
position camera object position x(1),object position y(1),-100
return
` I think that covers it.. sorry to muck around so much with the code, I hope it is what you required minus the Matrix changes.. I will try and deal with this if it cannot be rectified but can't say how well I can sort this part.
1ghz Cel,512 sdram 133,Gf2 MX 400 64,SBL 5.1,Win98
Best Upcoming MMOG - http://WWW.Atriarch.com
Project: Card Game with No Name