bool ProcessFrame() { if(InMenu) { return true; } float x, y; Gerad.Getxy(x, y); if(Gerad.GetWalk()) { if(InInterior) { if(CheckForExit(x, y)) { int x, y; exitLocation->interiors[currentInterior].getxy(x, y); y += 20; Gerad.Setxy(x, y); currentLocation = exitLocation; Gerad.SetFront(); background.load(currentLocation->getName()); background.loadGLTextures(); InInterior = false; return true; } } interiorLoop(x, y); if(Gerad.GetRight()) { return GeradMoveRight(x, y); } else if(Gerad.GetBack()) { return GeradMoveBack(x, y); } else if(Gerad.GetFront()) { return GeradMoveFront(x, y); } else if(Gerad.GetLeft()) { return GeradMoveLeft(x, y); } } return true; }
void keyboard(unsigned char key, int x, int y) { switch(key) { case 'w': case 'W': w = true; Gerad.SetBack(); Gerad.SetWalkStatus(); break; case 's': case 'S': s = true; Gerad.SetFront(); Gerad.SetWalkStatus(); break; case 'a': case 'A': a = true; Gerad.SetLeft(); Gerad.SetWalkStatus(); break; case 'd': case 'D': d = true; Gerad.SetRight(); Gerad.SetWalkStatus(); break; case 'i': case 'I': InMenu = !InMenu; break; case 13: CheckNPC(); break; case 27: exit(0); break; default: break; } }
void SetFront() { Gerad.SetFront(); }