Example #1
0
void GeoScene::Render()
{
	ofBackground(0, 255);
	ofSetColor(255);
	ofPushMatrix();
		geoBack.draw(0,0,0);
	ofPopMatrix();

	GeoHands* gh;
	for (vector<Particle*>::iterator h = pHandPositions->begin(); h != pHandPositions->end(); ++h)
	{	
		gh= (GeoHands*)(*h);

		gh->drawHands();
	}

	GeoParticle* gp;
	for (vector<Particle*>::iterator p = pPeople->begin(); p != pPeople->end(); ++p)
	{
		gp = (GeoParticle*)(*p);
		ofVec4f  position = (*p)->pos;
		ofPushMatrix();
			
		    ofTranslate((*p)->pos);
			ofSetColor(col);
			gp->draw();
		ofPopMatrix();

	}
}
Example #2
0
void GeoScene::Update(int timeScale)
{
	//update hands
	GeoParticle* gp;
	GeoHands* gh;
	for (vector<Particle*>::iterator h = pHandPositions->begin(); h != pHandPositions->end(); ++h)
	{
		gh= (GeoHands*)(*h);

		for (vector<Particle*>::iterator p = pPeople->begin(); p != pPeople->end(); ++p)
		{
			gp = (GeoParticle*)(*p);
			if(gp->m_isExploding) continue;

			if ((*h)->pos.x + radius > ((*p)->pos.x ) && (*h)->pos.x - radius<((*p)->pos.x ))
			{
				if ((*h)->pos.y -50 + radius >((*p)->pos.y  ) && (*h)->pos.y - radius < ((*p)->pos.y))
				{
					

					//gp->vel.x = gp->vel.x /2 ;
					gp->countDown(timeScale);
					onTarget = true;
					gh->handCountDown(timeScale, onTarget);	

					if( gp->m_isDead){
						pPeople->erase(p, p);
					}

					goto stopSearching;
				}
			}
			


		}

	}

	stopSearching:

	//update geo particles
	for (vector<Particle*>::iterator p = pPeople->begin(); p != pPeople->end(); ++p)
	{
		gp = (GeoParticle*)(*p);
		gp->update(timeScale);
		
	}	

}
Example #3
0
void GeoScene::Render()
{
	ofBackground(0, 255);
	ofSetColor(255);
	ofPushMatrix();
		geoBack.draw(0,0,0);
	ofPopMatrix();

	GeoHands* gh;
	for (vector<Particle*>::iterator h = pHandPositions->begin(); h != pHandPositions->end(); ++h)
	{
		gh = (GeoHands*)(*h);
		ofPushMatrix();
			//ofSetColor(0,200,200,70);
			//ofScale(radius,radius);
			gh->drawHands(geoHands);
			
		ofPopMatrix();
	}

	GeoParticle* gp;

	m_gradients.bind();

	for (vector<Particle*>::iterator p = pPeople->begin(); p != pPeople->end(); ++p)
	{
		gp = (GeoParticle*)(*p);
		ofVec4f  position = (*p)->pos;
		
		//ofPushMatrix();
			
		    //ofTranslate((*p)->pos);
			//ofSetColor(col);
			gp->draw(m_gradients, explosionSprite);
		//ofPopMatrix();

	}

	m_gradients.unbind();



}
Example #4
0
void GeoScene::Update(int deltaTime)
{
	GeoParticle* gp;
	GeoHands* gh;
	for (vector<Particle*>::iterator h = pHandPositions->begin(); h != pHandPositions->end(); ++h)
	{
		gh= (GeoHands*)(*h);

		for (vector<Particle*>::iterator p = pPeople->begin(); p != pPeople->end(); ++p)
		{
			gp = (GeoParticle*)(*p);
			
			
			if ((*h)->pos.x + radius > ((*p)->pos.x ) && (*h)->pos.x - radius<((*p)->pos.x ))
			{
				if ((*h)->pos.y -50 + radius >((*p)->pos.y  ) && (*h)->pos.y - radius < ((*p)->pos.y))
				{
					
					gp->vel.x = 1 ;
					gp->countDown(deltaTime);
					onTarget = true;
					gh->handCountDown(deltaTime, onTarget);	
					
				}
			}
			else{
				(*p)->vel.x = ofRandom(3,4);
				col = ofColor(255, 255, 255);
				radius = 100;
				onTarget = false;
			//	gh->handCountDown(deltaTime,onTarget);
					


			}
		}

	}

}