It works also on that way:
Graphics3D 640,480
cam = CreateCamera()
MoveEntity cam,0,0,-5
sp = CreateSprite()
RotateSprite sp,20
While Not KeyDown(1)
If KeyDown(200) And KeyDown(205) Then
;this statement first, otherweise each of those two
; would be catched either by
; If KeyDown(200)... or
; If KeyDown(205)...
MoveEntity sp,.1,.1,0
ElseIf KeyDown(200) Then ; up
MoveEntity sp,0,.1,0
ElseIf KeyDown(203) Then ;left
MoveEntity sp,-.1,0,0
ElseIf KeyDown(205) Then ;right
MoveEntity sp,.1,0,0
ElseIf KeyDown(208) Then ;down
MoveEntity sp,0,-.1,0
EndIf
RenderWorld
Text 10,10, "UP : " +Str$(KeyDown(200))
Text 10,30, "RIGHT : " +Str$(KeyDown(205))
Text 10,50, "DOWN : " +Str$(KeyDown(208))
Text 10,70, "LEFT : " +Str$(KeyDown(203))
Flip
Wend
End
Graphics3D 640,480
cam = CreateCamera()
MoveEntity cam,0,0,-5
sp = CreateSprite()
RotateSprite sp,20
While Not KeyDown(1)
If KeyDown(200) And KeyDown(205) Then
;this statement first, otherweise each of those two
; would be catched either by
; If KeyDown(200)... or
; If KeyDown(205)...
MoveEntity sp,.1,.1,0
ElseIf KeyDown(200) Then ; up
MoveEntity sp,0,.1,0
ElseIf KeyDown(203) Then ;left
MoveEntity sp,-.1,0,0
ElseIf KeyDown(205) Then ;right
MoveEntity sp,.1,0,0
ElseIf KeyDown(208) Then ;down
MoveEntity sp,0,-.1,0
EndIf
RenderWorld
Text 10,10, "UP : " +Str$(KeyDown(200))
Text 10,30, "RIGHT : " +Str$(KeyDown(205))
Text 10,50, "DOWN : " +Str$(KeyDown(208))
Text 10,70, "LEFT : " +Str$(KeyDown(203))
Flip
Wend
End