Esempio n. 1
0
void 
Game::Draw(BackBuffer& backBuffer)
{
	++m_frameCount;
	backBuffer.SetClearColour(0, 0, 0);
	backBuffer.Clear();

	// Ex006.3: Draw all enemy aliens in container...
	for (int i = 0; i < m_enemyShip.size(); i++) {
		m_enemyShip[i]->Draw(backBuffer);
	}

	// Ex006.4: Draw all bullets in container...
	for (int i = 0; i < m_bullet.size(); i++) {
		m_bullet[i]->Draw(backBuffer);
	}

	// Draw the explosions
	for (int i = 0; i < m_explosion.size(); i++) {
		m_explosion[i]->Draw(backBuffer);
	}

	// Draw the particle within the emitter // encapsulate this!
	if (m_pEmitter->IsEmitting()) {
		m_pEmitter->Draw(backBuffer);
	}


	// Ex006.2: Draw the player ship...
	m_playerShip->Draw(backBuffer);

	backBuffer.Present();
}
Esempio n. 2
0
void 
Game::Draw(BackBuffer& backBuffer)
{
	++m_frameCount;

	backBuffer.SetClearColour(0,0,0);
	backBuffer.Clear();
	bg->Draw(*m_pBackBuffer);
	
	// Draw all enemy aliens in container...
	std::vector<Enemy*>::iterator enemyIterator;
	for(enemyIterator = m_EnemyVector.begin();
		enemyIterator != m_EnemyVector.end();
		++enemyIterator)
	{
		(*enemyIterator)->Draw(backBuffer);
	}
	//draw platfomrs 
	std::vector<Platform*>::iterator platIterator;
	for (platIterator = m_PlatVector.begin();
	platIterator != m_PlatVector.end();
		++platIterator)
	{
		(*platIterator)->Draw(backBuffer);
	}

	// Draw all bullets in container...
	std::vector<Bullet*>::iterator bulletIterator;
	for(bulletIterator = m_BulletVector.begin();
		bulletIterator != m_BulletVector.end();
		++bulletIterator)
	{
		(*bulletIterator)->Draw(backBuffer);
	}
	

		
	

		
	// Draw the player ship...
	m_pPlayer->Draw(*m_pBackBuffer);
	
	//Draw explosions
	std::vector<Explosion*>::iterator ExplosionIterator;
	for (ExplosionIterator = Explosions.begin(); ExplosionIterator != Explosions.end(); ++ExplosionIterator)
	{
		(*ExplosionIterator)->Draw(backBuffer);
	}
	

	backBuffer.Present();
}
Esempio n. 3
0
void 
Game::Draw(BackBuffer& backBuffer)
{
	++m_frameCount;

	backBuffer.Clear();

	// Ex006.3: Draw all enemy aliens in container...

	// Ex006.4: Draw all bullets in container...

	// Ex006.2: Draw the player ship...

	backBuffer.Present();
}
Esempio n. 4
0
void Label::SetText(std::string textOnScreen, BackBuffer& backbuffer) {
	if (m_text == textOnScreen) {
		return;
	}
	m_text = textOnScreen;
	m_textTexture = backbuffer.CreateText(textOnScreen, m_colour);

}
Esempio n. 5
0
void 
AnimatedSprite::Draw(BackBuffer& backbuffer)
{
	// Ex007.1: Draw the particular frame into the backbuffer.
	backbuffer.DrawAnimatedSprite(*this, m_frameCoords[m_currentFrame], m_frameWidth);
	//          What is the current frame's x coordinate?
	//          What is the frame width?

}
void
AnimatedSprite::Draw(BackBuffer& backbuffer)
{
	// Ex007.1: Draw the particular frame into the backbuffer.

	//          What is the current frame's x coordinate?
	//          What is the frame width?


	this->m_width = m_frameWidth;

	backbuffer.DrawAnimatedSprite(*this);
}
Esempio n. 7
0
void 
Sprite::Draw(BackBuffer& backbuffer)
{
	backbuffer.DrawSprite(*this);
}