Example #1
0
void KeyPickup::Render(unsigned char type)
{
    GLuint t;
    if(type==DIFFUSE)
        t=tex;
    if(type==NORMAL)
        t=texN;
    if(type==GLOW)
    {
        t=texG;
        if(id==RED)
            glColor3f(1.0, 0.1, 0.1);
        if(id==BLUE)
            glColor3f(0.1, 0.1, 1.0);
        if(id==GREEN)
            glColor3f(0.1, 1.0, 0.1);
    }
    SpriteT(DajPoz(),DajDim(),rotation,t);
    glColor3f(1.0, 1.0, 1.0);
}
Example #2
0
void SmecePickup::Update(float deltaT)
{
	Stvar::Update(deltaT);		
	
	if(brzina>0.0)
	{
		s->PromijeniPoz(DajSredinu());
		if(cesticaTimer>=1.0)
		{
			SmeceCestica* c=(SmeceCestica*)stanje->DodajCesticu(new SmeceCestica());
			c->Init(DajPoz(),stanje);		
			cesticaTimer=0.0;
		}
		else
			cesticaTimer+=deltaT*10;

		poz.y+=smjer.y*brzina*deltaT;
		if(ProvjeraSudara()==true)
		{
			poz.y-=smjer.y*brzina*deltaT;
			smjer.y=-smjer.y;
		}
		poz.x+=smjer.x*brzina*deltaT;
		if(ProvjeraSudara()==true)
		{
			poz.x-=smjer.x*brzina*deltaT;
			smjer.x=-smjer.x;
		}
		brzina-=100*deltaT;
	}
	else
	{
		brzina=0.0;
	}

	
}