It's ok. I wasn't offended. I used to be a newbie too... in some ways I still am.
I do need to tell you about your use of scancode(). I used to think (like you) that scancode() could be used in that way. But scancode() is designed to only inform the programmer of what numbers are assigned to what keys. It is not meant to be used as a way to check for input keys. The main reason is because it will only return the lowest number currently being pressed. If you press two keys at once (like a and q) it will only show (q) as being pressed because the scancode for (q) is 16 and (a) is 30.
Try pressing more than one key with this code:
do
a=scancode()
cls
text 10,10,"Scancode = "+str$(a)
loop
Keystate() is designed to be used to check for keys. Here's what the help file says about keystate():
Quote: "KEYSTATE
This command will return an integer value of one if the key specified by the scancode is pressed, otherwise zero will be returned. The scancode value is the raw value assigned to the key of the keyboard device and very often is ordered sequentially from the top left of the keyboard to the bottom right.
SYNTAX
Return Integer=KEYSTATE(Scancode)"
Notice above how the syntax says KEYSTATE(Scancode)... as in the scancode found out with the scancode command. When you use keystate you can check for multiple keys being pressed.
So it's best to do this:
do
rem Movement
cx#=camera angle x (0) : cy#=camera angle y(0) : cz#=camera angle z(0)
if keystate(17) then move camera 0,5
if keystate(17) and shiftkey()=1 then move camera 0,10
if keystate(31) then move camera 0,-2
if keystate(30) then yrotate camera 0,cy#-90 : move camera 4 : yrotate camera 0,cy#
if keystate(32) then yrotate camera 0,cy#+90 : move camera 4 : yrotate camera 0,cy#
if keystate(201) then pitch camera up 0,5
if keystate(209) then pitch camera down 0,5
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<335 then xrotate camera 0,335
rotate camera camera angle x(0)+(mousemovey()/5.0),camera angle y(0)+(mousemovex()/5.0),0
loop