diff options
Diffstat (limited to 'src/GameTick.cpp')
-rw-r--r-- | src/GameTick.cpp | 102 |
1 files changed, 1 insertions, 101 deletions
diff --git a/src/GameTick.cpp b/src/GameTick.cpp index 708508e..2e9c71a 100644 --- a/src/GameTick.cpp +++ b/src/GameTick.cpp @@ -124,9 +124,6 @@ void Game::updateSong() void Game::handleMenu() { - if (IsKeyDown(GLFW_KEY_SPACE)) - mainmenu = 0; - GetMouse(&mouseloc); float mousex = (float) mouseloc.h * 640 / screenwidth; float mousey = 480 - (float) mouseloc.v * 480 / screenheight; @@ -178,91 +175,6 @@ void Game::handleMenu() } } -void Game::handleToggles() -{ - if (!IsKeyDown(psychickey)) { - oldvisionkey = 0; - } else if (!oldvisionkey) { - oldvisionkey = 1; - if (visions ^= 1) { - flashamount = flashr = 1; - flashg = flashb = 0; - alSourceStop(gSourceID[visionsound]); - alSourcePlay(gSourceID[souloutsound]); - - alSourcef(gSourceID[knifesong], AL_PITCH, 0.5f); - alSourcef(gSourceID[shootsong], AL_PITCH, 0.5f); - alSourcef(gSourceID[zombiesong], AL_PITCH, 0.5f); - alSourcePlay(gSourceID[visionsound]); - bodycoords = person[0].oldplayercoords; - } else { - flashamount = flashr = flashg = flashb = 1; - alSourceStop(gSourceID[visionsound]); - alSourcePlay(gSourceID[soulinsound]); - - alSourcef(gSourceID[knifesong], AL_PITCH, 1.0f); - alSourcef(gSourceID[shootsong], AL_PITCH, 1.0f); - alSourcef(gSourceID[zombiesong], AL_PITCH, 1.0f); - - XYZ towards = person[0].playercoords - bodycoords; - if (towards.x || towards.z) { - Normalise(&towards); - camera.rotation = RadiansToDegrees(asin(towards.x)); - if (towards.z > 0) - camera.rotation = 180 - camera.rotation; - - camera.visrotation = camera.rotation; - camera.oldrotation = camera.rotation; - } - - person[0].playercoords = bodycoords; - person[0].oldplayercoords = bodycoords; - person[0].velocity = 0; - } - } - - if (!IsKeyDown(GLFW_KEY_TAB)) { - tabkeydown = 0; - } else if (!tabkeydown && debug) { - thirdperson++; - if (thirdperson > 2) - thirdperson = 0; - tabkeydown = 1; - } - - if (!IsKeyDown(aimkey)) { - aimtoggle = 0; - } else if (!aimtoggle) { - person[0].aiming ^= aimtoggle = 1; - } - - if (!IsKeyDown(GLFW_KEY_R)) { - reloadtoggle = 0; - } else if (!reloadtoggle) { - if (person[0].reloads[person[0].whichgun] > 0 - && person[0].reloading <= 0) - person[0].ammo=-1; - reloadtoggle = 1; - } - - if (!IsKeyDown(psychicaimkey)) { - slomokeydown = 0; - } else if (!slomokeydown && !slomo) { - flashamount = 0.5; - flashr = 1; - flashg = flashb = 0; - alSourcePlay(gSourceID[souloutsound]); - - slomokeydown = 1; - slomo = 2; - score -= 20; - - alSourcef(gSourceID[knifesong], AL_PITCH, 0.5f); - alSourcef(gSourceID[shootsong], AL_PITCH, 0.5f); - alSourcef(gSourceID[zombiesong], AL_PITCH, 0.5f); - } -} - void Game::mouseLook() { if ((person[0].aimamount <= 0 @@ -470,7 +382,6 @@ void Game::Tick() flatfacing.y = 0; Normalise(&flatfacing); - handleToggles(); mouseLook(); //Check collision with buildings @@ -689,16 +600,6 @@ void Game::Tick() } - if (IsKeyDown(GLFW_KEY_SPACE) - && person[0].playerrotation == person[0].playerlowrotation - && person[0].targetanimation == joganim - && person[0].currentanimation == joganim - && !person[0].backwardsanim && !visions) { - person[0].targetanimation = diveanim; - person[0].targetframe = person[0].target = 0; - person[0].aimamount = 0; - } - //Camera camera.oldposition=camera.position; camera.targetoffset=0; @@ -2136,8 +2037,7 @@ void Game::Tick() } XYZ end {start + aim * 1000}; - if (debug && j == 0 - && IsKeyDown(GLFW_KEY_G)) { + if (debug && j == 0 && IsKeyDown(GLFW_KEY_G)) { sprites.MakeSprite(grenadesprite, 1, 1, 1, 1, start, aim * 200, 1.01); continue; |