Large diffs are not rendered by default.

@@ -2,6 +2,7 @@
#include <GL/freeglut.h>
#include "Texture.h"
#include "vec.h"
#include "AudioPlayer.h"
#include <opencv2\features2d\features2d.hpp>
#include <math.h>
#include <iostream>
@@ -28,17 +29,18 @@ int onLcircleDraw = 0;
int onRcircleDraw = 0;



void hand_drawLoadingcircle(float angleInPies, float r, float t) {
glBegin(GL_QUAD_STRIP);
for (float i = 0; i <= (angleInPies) * PI; i += 0.001f)
{
glVertex2f(r * sin(i), r * cos(i));
glVertex2f((r - t) * sin(i), (r - t) * cos(i));
}
for (float i = 0; i <= (angleInPies)* PI; i += 0.001f)
{
glVertex2f(r * sin(i), r * cos(i));
glVertex2f((r - t) * sin(i), (r - t) * cos(i));
}
glEnd();
}

void hand_draw()
void hand_draw()
{
glEnable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
@@ -60,7 +62,7 @@ void hand_draw()
glTexCoord2f(0, 0); glVertex2f(GSIZE, GSIZE);
glTexCoord2f(1, 0); glVertex2f(-GSIZE, GSIZE);
glEnd();

glPopMatrix();
righthand->bind();
glPushMatrix();
@@ -78,20 +80,20 @@ void hand_draw()
glPopMatrix();
glDisable(GL_BLEND);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glPushMatrix();
glPushMatrix();
glDisable(GL_TEXTURE_2D);

if (1 == onLcircleDraw) {
if (1 == onLcircleDraw) {
glTranslatef(lhp.x, lhp.y, 0);
glScalef(1, -1, 1);
glScalef(1, -1, 1);
glColor3f(1.0f, 1.0f, 1.0f);
hand_drawLoadingcircle(angleInPiesL,71.6f, 30.0f); //white circle
hand_drawLoadingcircle(angleInPiesL, 71.6f, 30.0f); //white circle
glColor3f(0.0f, 0.0f, 0.0f);
hand_drawLoadingcircle(angleInPiesL, 66.6f, 20.0f); //black circle
}
if (1 == onRcircleDraw) {
glTranslatef(rhp.x, rhp.y, 0);
glScalef(1, -1, 1);
glScalef(1, -1, 1);
glColor3f(1.0f, 1.0f, 1.0f);
hand_drawLoadingcircle(angleInPiesR, 71.6f, 30.0f); //white circle
glColor3f(0.0f, 0.0f, 0.0f);
@@ -101,31 +103,45 @@ void hand_draw()
glEnable(GL_LIGHTING);
glPopMatrix();
}
void hand_update(float ellapesdTime,bool circle){
void hand_update(float ellapesdTime, bool circle) {

rotationL = atan2(lhp.y - motionO.y, lhp.x - motionO.x) * 180.0f / 3.1415f;
rotationR = atan2(rhp.y - motionO.y, rhp.x - motionO.x) * 180.0f / 3.1415f;
if (circle == true) {
if (ellapesdTime < 1.0f) {
angleInPiesR += 1.2f * ellapesdTime;
angleInPiesL += 1.2f * ellapesdTime;
}if (angleInPiesR > 2.2f) {
angleInPiesR = 0;
onRcircleDraw = 0;

//do *plunk*
}
if (angleInPiesL > 2.2f) {
angleInPiesL = 0;
onLcircleDraw = 0;
keys['s'] = true;
//do *plunk*
}

if (lhp.y > height - height / 6 && lhp.x < width / 2) { onLcircleDraw = 1; onRcircleDraw = 0; } //lefthand presses somthing
if (rhp.y > height - height / 6 && rhp.x > width / 2) { onRcircleDraw = 1; onLcircleDraw = 0; } //lefthand presses somthing
if (lhp.y < height - height / 6 || lhp.x > width / 2) { onLcircleDraw = 0; angleInPiesL = 0; } //lefthand release
if (rhp.y < height - height / 6 || rhp.x < width / 2) { onRcircleDraw = 0; angleInPiesR = 0; } //righthand release

if (circle) {
cout << angleInPiesL << endl;
if (lhp.y > height - height / 6 && lhp.x < width / 2) {
onLcircleDraw = 1; onRcircleDraw = 0;
if (angleInPiesL == 0) {
PlayChargingSound();
}

if (ellapesdTime < 1.0f) {
angleInPiesR += 1.2f * ellapesdTime;
angleInPiesL += 1.2f * ellapesdTime;
}if (angleInPiesR > 2.2f) {
angleInPiesR = 0;
onRcircleDraw = 0;
KillChargingSound();
PlaySoundOnce("ButtonClick.wav");

//do *plunk*
}
if (angleInPiesL > 2.2f) {
angleInPiesL = 0;
onLcircleDraw = 0;
keys['s'] = true;
KillChargingSound();
PlaySoundOnce("ButtonClick.wav");

//do *plunk*
}

} //lefthand presses somthing
//if (rhp.y > height - height / 6 && rhp.x > width / 2) { onRcircleDraw = 1; onLcircleDraw = 0; } //lefthand presses somthing
if (lhp.y < height - height / 6 || lhp.x > width / 2) { onLcircleDraw = 0; angleInPiesL = 0; KillChargingSound(); } //lefthand release
//if (rhp.y < height - height / 6 || rhp.x < width / 2) { onRcircleDraw = 0; angleInPiesR = 0; } //righthand release


}
}

@@ -7,6 +7,7 @@
#include "Texture.h"
#include "Vec.h"
#include "MagicHands.h"
#include "AudioPlayer.h"
#include <time.h>

GLuint FramebufferName;
@@ -163,6 +164,7 @@ void MainMenuState::update(float deltaTime)

if (keys['s']) {
manager->changeState(1);
PlaySoundOnce("ButtonClick.wav");
}
}

@@ -27,7 +27,7 @@ float ObstacleGenerator::getNextObstacle() {
{

int randomHeight = rand() % MAX_GAP_DISTANCE + 0; //random number between 0 and gap distance
std::cout << randomHeight << std::endl;
//std::cout << randomHeight << std::endl;
topTemp = new ObstacleComponent();
topTemp->gapY = (MARGIN_GAP_HEIGHT / 2) + randomHeight;
bottemTemp = new ObstacleComponent();
@@ -2,6 +2,7 @@
#include "AudioPlayer.h"
#include "GameObject.h"
#include "MoveToComponent.h"
#include "GameStateManager.h"
#include "MotionInput.h"
#include <iostream>
#define TICKS_TO_RISE 40
@@ -4,7 +4,9 @@
#include <string>
#include <opencv2\features2d\features2d.hpp>
#include "Debuginfo.h"
#include <cmath>
#include "MagicHands.h"
#include "AudioPlayer.h"
#include "Vec.h"

#include "Game.h"
@@ -108,10 +110,15 @@ void PlayingState::update(float deltaTime)
hand_update(deltaTime,false);
if (flapspeed != 0.0 || keys[' ']) hasFlapped = true;
if (hasFlapped) {
total_score += playingGame->update(deltaTime);
int i = playingGame->update(deltaTime);
total_score += i;
if (i > 0)
PlaySoundOnce("PointGainSound.wav");
}
if (hasCollided) {
manager->changeState(0);
PlaySoundOnce("AUW-crashsound.wav");
Sleep(200);// zodat overgang iets natuurlijker is
}

}
@@ -123,6 +130,7 @@ void PlayingState::init()
hasCollided = false;
cameraOffset = { 0,0,0 };
playingGame->init();
PlaySoundOnce("FlapToStart.wav");
}

void PlayingState::deInit()