Here is a function you can place in your main loop to control player using WASD and mouse movement
void GetUserInput( void){
float camangx = dbWrapValue(dbCameraAngleX()+dbMouseMoveY());
float camangy = dbWrapValue(dbCameraAngleY()+dbMouseMoveX());
float camangz =dbCameraAngleZ();
dbRotateCamera (camangx,camangy,camangz);
if (dbKeyState(17)) { // W Move Forward
dbMoveCamera(3);
}
if (dbKeyState(31)) { // S Move Back
dbMoveCamera(-3);
}
if (dbKeyState(30)){ // A straffe left
dbTurnCameraLeft(90);
dbMoveCamera (3);
dbTurnCameraRight(90);
}
if (dbKeyState(32)){ // D straffe Right
dbTurnCameraRight(90);
dbMoveCamera (3);
dbTurnCameraLeft(90);
}
}
Codger
System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem