Hey xeno, everything is great with your tuts, I wanted to learn a little bit of 3d but I'm mainly staying 2d for my small project. But, I'm having an error code at a loop, db is asking for an angle where there is none needed, maybe someone can point this out to me as I'm not seeing where the problem is.
Sync On : Sync Rate 0:cls
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
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
Do
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
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
Thanks again, and great tuts xeno.
Ian
Coffee coffee coffee coffee coffee coffee cappacino, JAVA!