Esempio n. 1
0
ExampleGame::ExampleGame(std::string resourcesRootPath):RTGame(resourcesRootPath)
{
    //glTexture    = new GLTexture("ExampleResources/ArialMT_30.png");
    glTexture  = new GLTexture("ExampleResources/Screenshot.jpg");
    //glTexture  = new GLTexture("ExampleResources/Screenshot.png");
    //glTexture  = new GLTexture("ExampleResources/textures.pvr");
    glSprite     = new GLSprite(glTexture, Rectangle(Point3D(), Size3D(glTexture->textureData()->size.w, glTexture->textureData()->size.h)));
    //glSprite   = new GLSprite(glTexture, Rectangle(Point3D(0, -glTexture->textureData()->size.h/4.0f), Size3D(glTexture->textureData()->size.w, glTexture->textureData()->size.h/2.0f)));
    //glSprite->z(5);
    //glSprite->transformations().translation(Point3D(-90, -100));
    //glSprite->transformations2D().translation(Point2D(-0.3, 0));
    //glSprite->transformations2D().rotation(Angle(75.0f));
    glSprite->transformations().scale(Size3D(0.5f, 0.5f, 1));
    
    glCamera = new GLCamera(Color(1,0.5,0.5,1));
    glCamera->children().push_back(glSprite);
    
    _rootRenderable->children().push_back(glCamera);
}
Esempio n. 2
0
Size3D Circle::getIntersection(Circle circle)
{
	float circlesDistance = _location.getDistance(circle.getLocation());
	float intersection    = _radius +  circle.getRadius() - circlesDistance;
	return Size3D(intersection,intersection);
	/*Point2D2 circleLocation = circle.getLocation();
	float xDistance = fmaxf(_location.getX(),circleLocation.getX()) - fminf(_location.getX(),circleLocation.getX());
	float xIntersection = _radius + circle.getRadius() - xDistance;
	if(xIntersection > 0)
	{
		float yDistance = fmaxf(_location.getY(),circleLocation.getY()) - fminf(_location.getY(),circleLocation.getY());
		float yIntersection = _radius + circle.getRadius() - yDistance;
		return Size2D(xIntersection,yIntersection);
	}
	return Size2D(xIntersection);*/
}
EntityBuilding::EntityBuilding(Point3D position) : EntityTile(position)
{
	char name[100];
	char idstring[10];
	
	ClassID = 1;
	CollisionBox = Size3D(3, 3, 2);

	MasterControl = nullptr;
	Destination = Point3D(1, 1, 0);

	BuildingStage = 1;
	WoodAmount = 10;
	StoneAmount = 0;

	lastHammerHitTick = 0;
	materialsToHammer = 0;

	LongInteract = true;

	AddToEditor = true;
}