diff options
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 7eb847e6c..9054f00cc 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1229,6 +1229,17 @@ void the_game( s32 dx = input->getMousePos().X - displaycenter.X; s32 dy = input->getMousePos().Y - displaycenter.Y; //std::cout<<"window active, pos difference "<<dx<<","<<dy<<std::endl; + + const float keyspeed = 500; + if(input->isKeyDown(irr::KEY_UP)) + dy -= dtime * keyspeed; + if(input->isKeyDown(irr::KEY_DOWN)) + dy += dtime * keyspeed; + if(input->isKeyDown(irr::KEY_LEFT)) + dx -= dtime * keyspeed; + if(input->isKeyDown(irr::KEY_RIGHT)) + dx += dtime * keyspeed; + camera_yaw -= dx*0.2; camera_pitch += dy*0.2; if(camera_pitch < -89.5) camera_pitch = -89.5; |