Home now, here is the source I'm using
RPG_TUTORIAL.DBA
REM ---------------------------------------------------------------------------------[Code Header]
Rem Project: RPG_Tutorial
Rem Created: Tuesday, December 18, 2012
Rem
Rem ***** Main Source File *****
REM -------------------------------------------------------------------------------[Config Header]
#INCLUDE menupart.dba
SYNC ON : SYNC RATE 0
REM ----------------------------------------------------------------------------------[BEGIN EXEC]
DO
IF button(20,55,"New Game")=1 GOTO New_Game
button(20,95,"Load Game")=1
IF button(20,235,"Exit")=1 THEN END
SYNC
LOOP
REM -----------------------------------------------------------------------------------[NEW_GAME]
NEW_GAME:
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
REM --------------------------------------------------------------------------NEW_GAME[Controls]
movespeed = 75
turnspeed = 87.5
time=timer()
DO
gameTime=timer()-time
MSframe#=gameTime*(movespeed/1000.0)
TSframe#=gameTime*(turnspeed/1000.0)
IF upkey()=1
MOVE OBJECT 1,MSframe#
ENDIF
IF downkey()=1
MOVE OBJECT 1,-MSframe#
ENDIF
IF leftkey()=1
DEC a#,TSframe#
ENDIF
IF rightkey()=1
INC a#,TSframe#
ENDIF
YROTATE OBJECT 1,a#
posx#=cos(270-a#)*30 + OBJECT POSITION x(1) // Direction + 270 Degrees so it appears behind
posz#=sin(270-a#)*30 + OBJECT POSITION z(1) // Direction + 270 Degrees so it appears behind
POSITION CAMERA posx#,OBJECT POSITION y(1)+6,posz#
POINT CAMERA OBJECT POSITION x(1),OBJECT POSITION y(1)+6,OBJECT POSITION z(1)
time=timer()
SYNC
LOOP
END
And the include:
MENUPART.DBA
REM ---------------------------------------------------------------------------------------FUNCTION[button]
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
Dead Teddy Studios, LLC.