Ugh. I just added a bit of code, and now it doesn't work. Compiles just fine, but stays at the "Get ready to Play" Screen. Doesn't do anything more. Code thus far:
Sync On : Sync Rate 0
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
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(100,50,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
New_Game:
cls
Text 240,220,"Get Ready to Play";
sync
wait 2000
cls
rem Start Game
Draw to front
Backdrop on
Set camera range 1,3000
Autocam off
Hide mouse
Fog on
Fog distance 3000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)
rem making matrix
make matrix 1,20000,20000,25,25
load image "grass01.png",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem Player object, sphere for now.
Make object sphere 2,25
color object 2,160
position object 2,10,0,2
rem Make Gun
Make object cylinder 1,2
XRotate Object 1,90
Fix object pivot 1
Scale object 1,100,500,100
position object 1,0,-7,15
Lock object on 1
do
rem Player movement
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,cAY#,7)
ZTest# = Newzvalue(Z#,cAY#,7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-180),7)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-180),7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Leftkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#-90),7)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#-90),7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Rightkey()=1
XTest# = Newxvalue(X#,Wrapvalue(cAY#+90),7)
ZTest# = Newzvalue(Z#,Wrapvalue(cAY#+90),7)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
Rem Rotate camera
cTestX#=WrapValue(cAX#-180)
if cTestX# > 225 then cAX#=45
if cTestX# < 135 then cAX#=315
YRotate camera CurveAngle(cAY#,oldcAY#,24)
XRotate camera CurveAngle(cAX#,oldcAX#,24)
Y# = Get ground height(1,X#,Z#)+35
loop
And I have another question, technical I believe. When I add more projects to DBpro, I mean, have more than 1 running, in tabs, if the first one is empty it displays another code's execution, regardless of which tab is selected. Also, even if one of the other tabs that have been opened have a problem, or (I think) are even partly repeated, it displays an error. If there's a repeated part, It displays an error. If you close all tabs and leave only one, still, if they have a problem, they'll pop back on. And it says there's a problem on a stupid line, i.e. 141 when your program is only about 72 lines. Help please?
-The only thing that doesn't require effort is nothing.
-If there's something in this world that you can't buy, that's experience.