Well, expletives are curse words, and people don't always appreciate you using them.
Seriously, it seems to me that you are trying to start at the beginning, with an onscreen menu. Press the New Game, and start a new game. Press Load game, and load a game. Then, after you are done pushing the cube around the blank scene, return to the first screen.
So, I copied the code, removed the backslashes, and ran it...although I already knew that I would exit, and not return to the first screen after I pushed the cube around.
So, like the first poster, I am asking you...what is not working about the code?
Sync On : Sync Rate 0
Do
if Button(20,55,"New Game")=1 then Gosub New_Game
Button(20,95,"Load Game")
If Button(20,135,"Exit")=1 then End
sync
loop
New_Game:
disable escapekey
cls
Repeat
Text 240,220,"Get Ready to Play";
sync
Until scancode()>0
make object box 1,4,3,5
make matrix 1,200,200,5,5
Position Matrix 1,-100,0,-100
Do
if escapekey() then exit
If Upkey()=1
Move Object 1,2
endif
If Downkey()=1
Move Object 1,-2
endif
If Leftkey()=1
Dec a#,2
endif
If Rightkey()=1
Inc a#,2
endif
yrotate object 1,a#
posx#=cos(270-a#) * 30 + object position x(1)
posz#=sin(270-a#) * 30 + object position z(1)
Position Camera posx#,object position y(1)+6,posz#
Point Camera object position x(1),object position y(1)+6,object position z(1)
sync
Loop
delete object 1
delete matrix 1
enable escapekey
return
end
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(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
Take a look at my changes. They look minor, but they are anything but minor. When you arrive at "end" in a Basic program, well...that is the end. As I said, there is no return from goto. goto is an absolute jump to a label.
So, first I made New_Game a subroutine by putting return between the end of the game loop and the end of your program. Next, I replaced the goto with gosub. The escape key disable goes at the start of the area that you want control of the escape key - your game code. At the end, I reenabled escape so that you can still use it to exit the top level menu. Is that what you wanted? Elsewhere, I read a thread that you started about the color of the menu items not changing...that is not an issue in this code, perhaps you mistook the logic error for that?
Finally, if you are going to reenter the code, you need to delete resources. The haphazard handling of objects in DBPro is a habit you had best not start. I deleted your cube and matrix for you. You also should remember the object number, or matrix number, and not use absolute values like that.