Added cheating teleport for presentation.
This commit is contained in:
parent
68eb615ac8
commit
188ae2b349
16
level.cc
16
level.cc
@ -70,7 +70,8 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
|
||||
}
|
||||
}
|
||||
|
||||
void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) {
|
||||
void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed,
|
||||
bool f1Pressed, bool f2Pressed, bool f3Pressed, bool f4Pressed) {
|
||||
|
||||
// Ignore first two mouse updates, because they are incorrect
|
||||
// DON'T try to move this functionallity elsewhere
|
||||
@ -111,6 +112,19 @@ void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseD
|
||||
}
|
||||
}
|
||||
|
||||
if(f1Pressed) {
|
||||
physics.forcePlayer(glm::vec3(17.5, 21.0, 87.0));
|
||||
}
|
||||
if(f2Pressed) {
|
||||
physics.forcePlayer(glm::vec3(-78.5, 21.75, 4.5));
|
||||
}
|
||||
if(f3Pressed) {
|
||||
physics.forcePlayer(glm::vec3(-169.5, 21.5, 58.5));
|
||||
}
|
||||
if(f4Pressed) {
|
||||
physics.forcePlayer(glm::vec3(-180.5, 21.75, 58.5));
|
||||
}
|
||||
|
||||
if(kPressed)
|
||||
camera.setIsPhysicsCamera(true);
|
||||
if(lPressed)
|
||||
|
3
level.hh
3
level.hh
@ -25,7 +25,8 @@ class Level {
|
||||
Level();
|
||||
~Level();
|
||||
void load();
|
||||
void update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta,bool wPressed, bool aPressed,bool sPressed, bool dPressed, bool kPressed, bool lPressed);
|
||||
void update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta,bool wPressed, bool aPressed,bool sPressed, bool dPressed, bool kPressed, bool lPressed,
|
||||
bool f1Pressed, bool f2Pressed, bool f3Pressed, bool f4Pressed );
|
||||
void render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
|
||||
glm::mat4* viewProjectionMatrix, std::vector<glm::mat4>* shadowVPs=0);
|
||||
glm::vec3 getAmbientLight();
|
||||
|
9
main.cc
9
main.cc
@ -166,6 +166,10 @@ int main( int argc, char *argv[] )
|
||||
int stateD = glfwGetKey(window, GLFW_KEY_D);
|
||||
int stateK = glfwGetKey(window, GLFW_KEY_K);
|
||||
int stateL = glfwGetKey(window, GLFW_KEY_L);
|
||||
int stateF1 = glfwGetKey(window, GLFW_KEY_F1);
|
||||
int stateF2 = glfwGetKey(window, GLFW_KEY_F2);
|
||||
int stateF3 = glfwGetKey(window, GLFW_KEY_F3);
|
||||
int stateF4 = glfwGetKey(window, GLFW_KEY_F4);
|
||||
|
||||
double xpos, ypos;
|
||||
glfwGetCursorPos(window, &xpos, &ypos);
|
||||
@ -173,10 +177,11 @@ int main( int argc, char *argv[] )
|
||||
app.getLevel()->update(now - lastUpdate, now - gameStart,
|
||||
glm::vec2((float)ypos-app.getGraphics()->getWindowSize().y/2,
|
||||
(float)xpos-app.getGraphics()->getWindowSize().x/2),
|
||||
stateW == GLFW_PRESS,stateA == GLFW_PRESS,stateS == GLFW_PRESS,stateD == GLFW_PRESS,stateK == GLFW_PRESS,stateL == GLFW_PRESS);
|
||||
stateW == GLFW_PRESS,stateA == GLFW_PRESS,stateS == GLFW_PRESS,stateD == GLFW_PRESS,stateK == GLFW_PRESS,stateL == GLFW_PRESS, stateF1 == GLFW_PRESS,
|
||||
stateF2 == GLFW_PRESS, stateF3 == GLFW_PRESS, stateF4 == GLFW_PRESS);
|
||||
}
|
||||
else {
|
||||
app.getLevel()->update(now - lastUpdate, now-gameStart, glm::vec2(0.0f, 0.0f), false, false, false, false,false,false);
|
||||
app.getLevel()->update(now - lastUpdate, now-gameStart, glm::vec2(0.0f, 0.0f), false, false, false, false,false,false,false,false,false,false);
|
||||
if (app.isLocked()) {
|
||||
app.ignoredOneMouseUpdate();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user