Rejilla::Rejilla() { // Carga el sprite con la textura setSprite(RUTA_OBJETOS_GFX); setSize(32, 32); setCentro(this->getSize().x/2, this->getSize().y/2); setFrame(2, 2, 1, 1); }
void CaixaParalela::configura(const Vetor_3D &_extremo_inferior, const Vetor_3D &_extremo_superior ) { float xmin, ymin, zmin, xmax, ymax, zmax; if(px1 != NULL) delete( px1 ); if(px2 != NULL) delete( px2 ); if(py1 != NULL) delete( py1 ); if(py2 != NULL) delete( py2 ); if(pz1 != NULL) delete( pz1 ); if(pz2 != NULL) delete( pz2 ); extremo_inferior = _extremo_inferior; // = _extremo_inferior); extremo_superior = _extremo_superior; xmin = extremo_inferior.X(); ymin = extremo_inferior.Y(); zmin = extremo_inferior.Z(); xmax = extremo_superior.X(); ymax = extremo_superior.Y(); zmax = extremo_superior.Z(); setCentro(Ponto_3D((xmin+xmax)/2, (ymin+ymax)/2, (zmin+zmax)/2)); setRaio( centro.distancia(Ponto_3D(xmin,ymin,zmin))); px1 = new PlanoX( xmin, ymin, ymax, zmin, zmax , indice_textura); px2 = new PlanoX( xmax, ymin, ymax, zmin, zmax , indice_textura); py1 = new PlanoY( ymin, xmin, xmax, zmin, zmax , indice_textura); py2 = new PlanoY( ymax, xmin, xmax, zmin, zmax , indice_textura); pz1 = new PlanoZ( zmin, xmin, xmax, ymin, ymax , indice_textura); pz2 = new PlanoZ( zmax, xmin, xmax, ymin, ymax , indice_textura); }
Player::Player() { init(); // Carga el sprite con la textura setSprite(RUTA_PLAYER_GFX); setSize(48, 48); setCentro(this->getSize().x/2, this->getSize().y/2); spawn.x = 0.f; spawn.y = 0.f; setPosition(spawn.x, spawn.y); // Inicializamos los poderes powers[0] = powers[1] = powers[2] = powers[3] = -1; // Temporizador para algunas habilidades powerTimer.restart(); frame = 0; }