Ejemplo n.º 1
0
void key_press(unsigned char key, int x, int y)
{
	switch(key)
	{
		case 's':
		case 'S':
			shot = capturePoints();
			if(gameState != STATE_CALIBRATE)
				calculateCoor();
			
			shot[0] = 0;
			shot[1] = 0;
			
			isShotFired = true;
			if(gameState == STATE_PLAY)
				checkAllHits();
			else if(gameState == STATE_HIGHSCORES)
				checkKeyboardTargets();
			break;
		case 'r':
		case 'R':
			playSound1();
			gameState = STATE_START;
			break;
		case 'q':
        case 'Q':
			stopCamera();
			releaseSounds();
            exit(0);
	}
}
Ejemplo n.º 2
0
/*
 *----------------------------------------------------------
 *	winPassive
 *	Handles passive house movements
 *	x, y - mouse position
 *----------------------------------------------------------
 */
static void winPassive (int x, int y)
{
    /*Verificar*/
    faces[OldFaceIndex].hit = FALSE;
    if (createVect)
    {
	    polygonPicking = TRUE;
	    checkHit(x,y);
	    polygonPicking = FALSE;
	    
	    capturePoints( x, y, &coords[0]);
	    faces[PointPicking].hit = TRUE;
	    OldFaceIndex = PointPicking;
    }
	
    oldMouseX = x;
    oldMouseY = y;
}