Beispiel #1
0
bool CheckNPC()
{
	if(currentLocation->npcs != NULL)
	{
		if(text1 || text2) { text1 = false; text2 = false; return true; }
		float x1, y1, x2, y2;
		Gerad.Getxy(x1, y1);
		for(int i = 0; i < currentLocation->NPCNum;i++)
		{
			currentLocation->npcs[i].Getxy(x2, y2);
			if(distance(x1, y2, x2, y2) < 50)
			{
				switch(i)
				{
				    case 0:
					    text1 = true;
					    break;
				    case 1:
					    text2 = true;
					    break;
				    default:
					    break;
				}
				return true;
			}
		}
	}
	return false;
}
Beispiel #2
0
bool checkInterior(int num)
{
	float x, y;
	int x1, y1;
	Gerad.Getxy(x, y);
	currentLocation->interiors[num].getxy(x1, y1);
	if(distance(x, y, x1, y1) < 20)
		return true;
	return false;
}
Beispiel #3
0
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;
}