Added camera click

This commit is contained in:
andreja6
2018-04-26 20:07:19 -07:00
parent e777f3ccc4
commit f4acbaacdc
2 changed files with 5 additions and 0 deletions

BIN
content/sounds/SWITCH3.wav Normal file

Binary file not shown.

View File

@@ -37,6 +37,7 @@ static G3D::RealTime messageTime = 0;
static G3D::RealTime inputTime = 0;
static int FPSVal[8] = {10, 20, 30, 60, 120, 240, INT_MAX,1};
static int index = 2;
static std::string cameraSound = "";
static float TIMERVAL = 60.0F;
static int SCOREVAL = 0;
static AudioPlayer soundSystem;
@@ -250,6 +251,7 @@ public:
void CameraButtonListener::onButton1MouseClick(BaseButtonInstance* button)
{
soundSystem.PlaySound(cameraSound);
CoordinateFrame frame = usableApp->debugCamera.getCoordinateFrame();
if(button->name == "CenterCam")
centerCam = true;
@@ -878,11 +880,13 @@ void Demo::onUserInput(UserInput* ui) {
if(ui->keyPressed(SDL_MOUSE_WHEEL_UP_KEY))
{
soundSystem.PlaySound(cameraSound);
CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
cameraPos = cameraPos + frame.lookVector()*2;
}
if(ui->keyPressed(SDL_MOUSE_WHEEL_DOWN_KEY))
{
soundSystem.PlaySound(cameraSound);
CoordinateFrame frame = app->debugCamera.getCoordinateFrame();
cameraPos = cameraPos - frame.lookVector()*2;
}
@@ -1371,6 +1375,7 @@ void App::main() {
cursor = Texture::fromFile(GetFileInPath("/content/cursor2.png"));
fntdominant = GFont::fromFile(GetFileInPath("/content/font/dominant.fnt"));
fntlighttrek = GFont::fromFile(GetFileInPath("/content/font/lighttrek.fnt"));
cameraSound = GetFileInPath("/content/sounds/SWITCH3.wav");
sky = Sky::create(NULL, ExePath() + "/content/sky/");
cursorid = cursor->openGLID();
applet->run();