ive been doing the tutorial "Just Purchased DB? Want to make an rpg?"
ive made the simple menu but ran into trouble when trying to make advanced terrain work with it.
i want the cube to go over the advanced terrain but it just goes through it...
this is the code
Rem Project: THE DARK ERA
Rem Created: Monday, January 12, 2009
Rem ***** Main Source File *****
Sync On : Sync Rate 0
Do
load image "menu 4 tda.bmp",1
paste image 1,1,1
if Button(400,384,"New Game")=1 then Goto New_Game
Button(400,434,"Load Game")
If Button(400,494,"Exit")=1 then End
sync
loop
rem new game
New_Game:
cls
Repeat
SET TEXT FONT "morpheus"
SET TEXT SIZE 30
Text 400,300,"Welcome to The Dark Era";
sync
sync
Until scancode()>0
make object box 1,4,3,5 rem 3d
mapsize =2400
segments= 64
make matrix 1,mapsize,mapsize,segments,segments
load image "Havreil Forest edge hm.bmp",1
size=256
load image "texture.bmp",2
prepare matrix texture 1,2,1,1
cls
paste image 1,0,0
modifier=size/segments
for x = 0 to segments
for y = 0 to segments
pixelcolor#=rgbr(point(x*modifier,y*modifier))
set matrix height 1,x,y,pixelcolor#
next x
next y
update matrix 1
movespeed = 75
turnspeed = 87.5
time=timer()
Do
gameTime=timer()-time
MSframe#=gameTime*(movespeed/1000.0)
TSframe#=gameTime*(turnspeed/1000.0)
rem controls
Playercontrol:
rem ---- Control Character ----
x#=object position x(1)
z#=object position z(1)
x#=newxvalue(x#,a#,speed#)
z#=newzvalue(z#,a#,speed#)
h#=get terrain ground height(1,x#,z#)
position object 1,x#,h#,z#
yrotate object 1,a#
if upkey()=1 and speed#<1.2 then speed#=speed#+0.2
if downkey()=1 and speed#>-1.2 then speed#=sspeed#-0.2
if leftkey()=1 then a#=wrapvalue(a#-1)
if rightkey()=1 then a#=wrapvalue(a#+1)
time=timer()
sync
Loop
end
rem text
function Button(x1,y1,WORDS$)
Pressed=0
SET TEXT FONT "morpheus"
SET TEXT SIZE 80
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,255,200),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
it won't even let me run it
attached is a pictur of what it looks like now.