void XWing::Draw(Core::Graphics& g)
{
	g;
	if(!isDead)
	{
		const unsigned int NUM_POINTS = sizeof(XWingPoints) / sizeof(*XWingPoints);
		for(unsigned int i = 0;i < NUM_POINTS - 1;i++)
		{
			Vector3D currentPoint = Vector3D(XWingPoints[i].x, XWingPoints[i].y) * scalar;
			Vector3D nextPoint = Vector3D(XWingPoints[(i+1) % NUM_POINTS].x, XWingPoints[(i+1) % NUM_POINTS].y) * scalar;

			const Vector3D& p1 = matrix * currentPoint + position;
			const Vector3D& p2 = matrix * nextPoint + position;

			g.DrawLine(p1.x, p1.y, p2.x, p2.y);
		}
		for(unsigned int i = NUM_POINTS - 1;i > 0;i--)
		{
			Vector3D currentPoint = Vector3D(-XWingPoints[i].x, XWingPoints[i].y) * scalar;
			Vector3D nextPoint = Vector3D(-XWingPoints[(i-1) % NUM_POINTS].x, XWingPoints[(i-1) % NUM_POINTS].y) * scalar;

			const Vector3D& p1 = matrix * currentPoint + position;
			const Vector3D& p2 = matrix * nextPoint + position;

			g.DrawLine(p1.x, p1.y, p2.x, p2.y);
		}
		if(state == GAME)
		{
			hb.Draw(g);
		}
	}
}
void VictoryScreen::Draw(Core::Graphics& graphics)
{
	graphics.DrawString((int)SCREEN_WIDTH / 2 - 15, (int)SCREEN_HEIGHT / 2,"YOU WON");
	graphics.DrawString((int)SCREEN_WIDTH / 2 - 190, (int)SCREEN_HEIGHT / 2 + 10,"Press R To Go Back To The Intro Screen Or Escape To Quit");
	graphics.DrawString((int)SCREEN_WIDTH / 2 - 22, (int)SCREEN_HEIGHT / 2 + 20,"Score: ");
	util.DrawValue(graphics,(int)SCREEN_WIDTH / 2 + 22, (int)SCREEN_HEIGHT / 2 + 20, score);
}
void IntroScreen::Draw(Core::Graphics& graphics)
{
	graphics.DrawString((int)SCREEN_WIDTH / 2 - 40,(int)SCREEN_HEIGHT / 5, "Press F To Begin");
	graphics.DrawString((int)SCREEN_WIDTH / 2 - 42,(int)SCREEN_HEIGHT / 5 + 10, "Press ESC To Quit");
	graphics.DrawString((int)SCREEN_WIDTH / 2 - 30, 0,"High Score: ");
	util.DrawValue(graphics,(int)SCREEN_WIDTH / 2 + 55, 0, score);
	hero->Draw(graphics);
}
示例#4
0
void Walls::draw(Core::Graphics& g)
{
	g.SetColor(RGB(255, 100, 255));
	for(unsigned int i = 0; i< NUM_WALL_POINTS; i++)
	{
		const Vector3D& w1 = *wallShape[i];
		const Vector3D& w2 = *wallShape[(i+1) % NUM_WALL_POINTS];
		g.DrawLine(w1.x, w1.y, w2.x, w2.y);
	}
}
示例#5
0
void GameplayFrame::DebugFrameMemory(Core::Graphics& graphics)
{
	graphics.SetColor(RGB(255,255,255));
	_CrtMemState myState;
	_CrtMemCheckpoint(&myState);
	myState.lCounts;
	char buf[50];
	sprintf_s(buf, "Current count: %i", myState.lCounts[_CLIENT_BLOCK]);
	graphics.DrawString(20, 870, buf);
	sprintf_s(buf, "Current size: %i", myState.lSizes[_CLIENT_BLOCK]);
	graphics.DrawString(20, 890, buf);
	sprintf_s(buf, "Current HighWaterCount: %i", myState.lHighWaterCount);
	graphics.DrawString(20, 910, buf);
}
示例#6
0
	void ParticleEffect::Draw(Core::Graphics& graphics)
	{
		graphics.SetColor(WHITE);
		for (unsigned int i = 0; i < numberofParticles; i++)
		{
			Engine::Vector2 draws[] = 
			{
				Engine::Vector2(1, 0) + particleList[i]->getPosition(),
				Engine::Vector2(0, 1) + particleList[i]->getPosition()
			};
			graphics.SetColor(particleList[i]->getColor());
			graphics.DrawLines(1, *draws);
		}
	}
示例#7
0
void EnemyShip::draw(Core::Graphics& g)
{
	const int numShippoints= sizeof(lerper)/sizeof(*lerper);
	Matrix3 rotato=rotato.rotate(angle);
	g.SetColor(RGB(200,100,100));
	if(!dead)
	{
		for(int i=0;i<numShippoints;i++)
		{

			const Vector2d& s1=rotato*lerper[i]+position;
			const Vector2d& s2=rotato*lerper[(i+1)%numShippoints]+position;
			g.DrawLine(s1.x,s1.y,s2.x,s2.y);
		}
	}
}
示例#8
0
void Draw(Core::Graphics& graphics){
	if (isEditingSpaceship){
		editor.Draw(graphics);
	}
	else{
		graphics.SetColor(defaultColor);

		if(!isMainMenu && !isControls){
			{
				PROFILE("LevelDraw");
				lvl.Draw(graphics);
			}
			{
				PROFILE("ParticlesDraw");
				manager->Draw(graphics);
			}
		}
		else if (isControls){
			Controls::Draw(graphics);
		}
		else{
			menu.Draw(graphics);
		}
	}

	Debug::DrawMemoryState(graphics, SCREEN_HEIGHT);
}
示例#9
0
void DrawValue::drawValue(Core::Graphics& graphics, int x, int y, float num)
{
	stringstream ss;
	ss << num;

	graphics.DrawString(x, y, ss.str().c_str());
}
示例#10
0
void Upgrade::DrawDiagonalBar(Core::Graphics& graphics, float thickness, Vector2D endPosition, Vector2D startPosition)
{
	for(int i=0; i<thickness; i++)
	{
		Vector2D start(startPosition.x, startPosition.y + i);
		Vector2D end(endPosition.x, endPosition.y + i);
		graphics.DrawLine(start.x, start.y, end.x, end.y);
	}
}
示例#11
0
void Upgrade::DrawVerticalBar(Core::Graphics& graphics, float thickness, float size, Vector2D startPosition)
{
	for(int i=0; i<thickness; i++)
	{
		Vector2D start(startPosition.x + i, startPosition.y);
		Vector2D end(startPosition.x + i, startPosition.y+size);
		graphics.DrawLine(start.x, start.y, end.x, end.y);
	}
}
示例#12
0
void Upgrade::DrawGraphicPoints(Core::Graphics& graphics, Vector2D* points, int numPoints)
{
	for(int i=0; i<numPoints; i++)
		{
			if(i+1 < numPoints)
			{
				Vector2D start =  points[i]+position;
				Vector2D end =  points[i+1]+position;
				graphics.DrawLine(start.x, start.y, end.x, end.y);
			}
			else
			{
				Vector2D start = points[i]+position;
				Vector2D end = points[0]+position;
				graphics.DrawLine(start.x, start.y, end.x, end.y);
			}
		}
}
示例#13
0
void Upgrade::DrawUpgrade(Core::Graphics& graphics, Vector2D mouse, float thickness)
{
	myColor = (CheckMouse(mouse))? RGB(134, 134, 134): RGB(94,94,94);
	
	if(upgradeCooldown < .5)
	{
		upgradeCooldown += .016f;
	}
	graphics.SetColor(myColor);
	for(int i=0; i<BOX_SIZE; i++)
	{
		Vector2D start(position.x + i, position.y);
		Vector2D end(position.x + i, position.y+BOX_SIZE);
		graphics.DrawLine(start.x, start.y, end.x, end.y);
	}
	if(CheckMouse(mouse))
	{
		viewText(graphics);
		if(Core::Input::IsPressed(Core::Input::BUTTON_LEFT)&&upgradeCooldown >= .5f && myCash.getCash() >= upgradeCost && upgradeCount < 5)
		{
			upgradeCooldown = 0;
			myCash.decreaseCash(upgradeCost);
			upgradeCount++;
		}
	}
	SetUpgradeCost();
	DrawGraphic(graphics);
	graphics.SetColor(RGB(255,255,255));
	if(upgradeCount > 4)
	{
		graphics.SetColor(RGB(255,0,0));
	}
	//Draws $
	DrawHorizontalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x, costPosition.y+thickness/2));
	DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, Vector2D(costPosition.x, costPosition.y + thickness));
	DrawHorizontalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x, costPosition.y+thickness+((Letter_Size-3*thickness)/2)));
	DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, Vector2D(costPosition.x+(Letter_Size-thickness), costPosition.y + thickness*2+((Letter_Size-3*thickness)/2)));
	DrawHorizontalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x, costPosition.y+2*thickness + (2*((Letter_Size-3*thickness)/2)-thickness/2)));
	DrawVerticalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x+(Letter_Size/2.5f), costPosition.y));
	//Draws Cost
	DrawLetters(graphics, thickness);
}
示例#14
0
void DrawValue::drawValue(Core::Graphics& graphics, int x, int y, Engine::Vector3D vector)
{
	stringstream ss;
	ss << "<";
	ss << vector.vector_x;
	ss << ", ";
	ss << vector.vector_y;
	ss << ">";

	graphics.DrawString(x, y, ss.str().c_str());
}
示例#15
0
void Grid::draw(Core::Graphics& g)
{
	for(int i = 0; i<numRows; i++)
	{
		for(int j = 0; j<numColumns; j++)
		{
			cells[i][j].draw(g);
		}
	}
	if(enemies.numActiveTroops==0)
	{
		g.SetColor(RGB(50,255,50));
	}
	else
	g.SetColor(RGB(200,50,50));
	g.DrawString((int)(cells[9][0].position.x+(cells[9][0].width/2))-30,(int)(cells[9][0].position.y+(cells[9][0].height/2))-10, "COMPILE");
	g.DrawLine(cells[9][0].position.x, cells[9][0].position.y, cells[9][0].position.x+cells[9][0].width, cells[9][0].position.y);
	g.DrawLine(cells[9][0].position.x+cells[9][0].width, cells[9][0].position.y, cells[9][0].position.x+cells[9][0].width, cells[9][0].position.y+cells[9][0].height);
	enemies.draw(g, Vector3D(100,100));
}
示例#16
0
void DrawValue(Core::Graphics& graphics, int x, int y, Matrix3 mat) {
	mat;
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 3; j++){
			stringstream ss;
			ss.precision(5);
			ss << mat.mat[j][i];
			graphics.DrawString(x + i * 75, y + j * 12, ss.str().c_str());
		}
	}
}
示例#17
0
void Upgrade::DrawGraphic(Core::Graphics& graphics)
{
	if(type==armor)
	{
		graphics.SetColor(RGB(255,242,59));
		DrawGraphicPoints(graphics, armorGraphic, armorSize);
	}
	else if(type==fuel)
	{
		graphics.SetColor(RGB(219,65,31));
		DrawGraphicPoints(graphics, fuelGraphic, fuelSize);
	}
	else if(type == health)
	{
		graphics.SetColor(RGB(103, 219, 31));
		DrawGraphicPoints(graphics, healthGraphic, healthSize);
	}
	else if(type == bullet)
	{
		graphics.SetColor(RGB(46, 46, 46));
		DrawGraphicPoints(graphics, bulletGraphic, bulletSize);
	}
}
示例#18
0
void Lerper::Draw(Core::Graphics& graphics)
{
	const unsigned int NUM_LINES = sizeof(Lerp) / sizeof(*Lerp);

	graphics.SetColor(RGB(255,100,0));
	for(unsigned int i = 0; i < NUM_LINES; i++)
	{
		const Vector2D& first = Lerp[i] + position;
		const Vector2D& second = Lerp[(i+1) % NUM_LINES] + position;

		graphics.DrawLine(first.vector_x, first.vector_y, second.vector_x, second.vector_y);
	}

	const unsigned int LERP_NUM_LINES = sizeof(LerpLines) / sizeof(*LerpLines);

	graphics.SetColor(RGB(255,100,100));
	for(unsigned int i = 0; i < LERP_NUM_LINES; i++)
	{
		const Vector2D& first = LerpLines[i];
		const Vector2D& second = LerpLines[(i+1) % LERP_NUM_LINES];

		graphics.DrawLine(first.vector_x, first.vector_y, second.vector_x, second.vector_y);
	}
}
示例#19
0
void EnemyShip::Draw(Core::Graphics& graphics)
{
	RGB from = ALIEN;
	RGB to = BLACK;
	float percent = 1 - (life / originalLife);
	graphics.SetColor(RGB(((GetRValue(to) - GetRValue(from)) * percent) + GetRValue(from),
		((GetGValue(to) - GetGValue(from)) * percent) + GetGValue(from),
		((GetBValue(to) - GetBValue(from)) * percent) + GetBValue(from)));

	//graphics.SetColor(ALIEN);

	Engine::Matrix3 transformations = Engine::Matrix3::Translation(shipPosition) * Engine::Matrix3::rotation(shipRotation);

	frame.draw(graphics, transformations);

	turret.draw(graphics, shipPosition);
}
void Bullet::draw(Core::Graphics& g)
{
	position = position + (velocity * Dt);
	if((position.X < 0 || position.X > 1000) && (position.Y > 1900 || position.Y < 0))
	{
		canBeDrawn = false;
	}

	if(canBeDrawn)
	{
		for(unsigned int i = 0; i < bulletShape.numOfPoints; i++)
		{
			const Vector2& first = position + (transformationMatrix * bulletShape.shapePoints[i]);
			const Vector2& second = position + (transformationMatrix *bulletShape.shapePoints[(i + 1) % bulletShape.numOfPoints]);
			g.DrawLine(first.X, first.Y, second.X, second.Y);
		}
	}
}
示例#21
0
void DrawValue::drawValue(Core::Graphics& graphics, int x, int y, Engine::Matrix3D matrix){
	const int length = 3;
	

	stringstream ss[length][length];
	for(unsigned int i = 0; i < length; i++)
	{
		int movingX = x;
		for(unsigned int j = 0; j < length; j++)
		{
			float trunc = floor((matrix.matrix[i][j] * 1000)/1000);
			ss[i][j] << trunc;
			graphics.DrawString(movingX,y,ss[i][j].str().c_str());
			movingX += 20;
		}
		y+= 20;
	}
}
示例#22
0
void DrawValue(Core::Graphics& graphics, int x, int y, Vector2d num ) {
	stringstream ss;
	ss.precision(5);
	ss << "x: " << num.x << " y: " << num.y;
	graphics.DrawString( x, y, ss.str().c_str());
}
示例#23
0
void DrawValue(Core::Graphics& graphics, int x, int y, double num ) {
	stringstream ss;
	ss.precision(5);
	ss << num;
	graphics.DrawString( x, y, ss.str().c_str());
}
示例#24
0
// Only used for tracing
void Window::drawAt(Core::Graphics& g, Vector offset)
{
	g.SetColor(RGB(255, 0, 0)); 
	box.drawAt(g, offset);
	deadzone.drawAt(g, offset);
}
示例#25
0
void DrawValue(Core::Graphics& graphics, int x, int y, size_t val) {
	stringstream ss;
	ss.precision(5);
	ss << val;
	graphics.DrawString( x, y, ss.str().c_str());
}
示例#26
0
void Upgrade::viewText(Core::Graphics& graphics)
{
	graphics.SetColor(RGB(6, 196, 130));
	graphics.DrawLine(position.x + (float)BOX_SIZE/2, position.y + (float)BOX_SIZE/4, position.x + (float)BOX_SIZE/2+50.0f, position.y - 200.0f);
	graphics.DrawLine(position.x + (float)BOX_SIZE/2+50.0f, position.y - 200.0f, position.x+(float)BOX_SIZE/2+400.0f, position.y-200.0f);
	if(type == armor)
	{
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-180.0f), "The armor upgrade increases the rate");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-160.0f), "at which your armor regens out of combat.");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-140.0f), "Your ship regens no armor until the first");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-120.0f), "upgrade has been purchased. The ship is");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-100.0f), "'out of combat' when you haven't taken");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-80.0f), "damage in over five seconds.");
	}	
	else if(type == fuel)
	{
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-180.0f), "The fuel upgrade increases the overall");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-160.0f), "efficiency of your spacecraft. What this");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-140.0f), "acutally means is that your fuel doesn't");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-120.0f), "drain like a Hummer's anymore. You've");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-100.0f), "gotta love that one mile to the gallon.");
	}	
	else if(type == health)
	{
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-180.0f), "The repair upgrade increases the rate");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-160.0f), "at which these small sort-of space wrenches");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-140.0f), "spawn that increase your ship's health");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-120.0f), "when picked up. The first upgrade causes");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-100.0f), "the wrenches to start spawning whilst");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-80.0f), "continual upgrades decrease the spawn time.");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-60.0f), "Spawn times (seconds): 60/45/30/20/15. ");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-40.0f), "WARNING: The spawn time resets when ");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-20.0f), "you purchase this upgrade to the new time.");
	}
	else if(type == bullet)
	{
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-180.0f), "The bullet upgrade increases the damage ");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-160.0f), "that your bullets deal to targets. Oh ");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-140.0f), "yeah by the way the enemies' health scale");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-120.0f), "as the time goes on so this upgrade might be ");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-100.0f), "a good idea, just saying.");
		graphics.DrawString(int(position.x + (float)BOX_SIZE/2+100.0f), int(position.y-80.0f), "Damage: 1(no upgrades)/2/3/5/8/12");
	}
}
示例#27
0
void GameplayFrame::DrawGame(Core::Graphics& graphics)
{
	PROFILE("Total Draw");
	myBackground.DrawBackdrop(graphics);
	graphics.SetColor( RGB( 255, 255, 255));
	char buf[50];
	sprintf_s(buf, "%f", debugTime);
	graphics.DrawString(35,980, buf);
	graphics.DrawString(5, 980, "FPS:");
	healthBar.DrawHealth(graphics);
	fuelGauge.DrawPlayerFuel(graphics);
	graphics.SetColor(RGB(51,51,51));
	boundaries.Draw(graphics);
	{
		PROFILE("Draw Planets");
		creator.DrawPlanets(graphics);
	}
	graphics.SetColor( RGB( 255, 255, 255));
	{
		PROFILE("Draw Enemies");
		tester.drawShips(graphics);
	}
	{
		PROFILE("Draw Particles");
		myParticles.drawEffect(graphics);
	}
	myText.drawText(graphics);
	graphics.SetColor(RGB(255,255,255));
	Vector2D fuel(fuelStation[1].x+(fuelStation[3].x-fuelStation[1].x)/4.5f, (fuelStation[0].y + ((fuelStation[2].y-fuelStation[0].y)/2.5f)));
	gameText.drawText(graphics, 4.0f, RGB(255,255,255), "Fueling", 20.0f, 5.0f, 0, fuel);
	gameText.drawText(graphics, 4.0f, RGB(255,255,255), "Station", 20.0f, 5.0f, 0, Vector2D(fuel.x, fuel.y + 35.0f));
	myCash.DrawCash(graphics, 5.0f);
	healthDrop.DrawHealthPickup(graphics);
	graphics.SetColor( RGB(255, 255, 255));
	graphics.DrawString(30, 100, "PRESS I TO OPEN/CLOSE THE LIST OF INSTRUCTIONS.");
	DebugFrameMemory(graphics);
	graphics.SetColor( RGB( 255, 100, 0));
	{
		ranger.Draw(graphics);
	}
	//rapidFirePowerup.drawPowerup(graphics);
	if(alreadyKilled)
	{
		char buf[50];
		sprintf_s(buf, "You survived for %i seconds!", (int)totalTime);
		Core::RGB textColor = RGB(255, 149, 0);
		gameText.drawText(graphics,  5.0f, textColor, "GAME OVER...", 30.0f, 5.0f, 0, Vector2D(250.0f, 250.0f));
		gameText.drawText(graphics,  5.0f, textColor, buf, 30.0f, 5.0f, 0, Vector2D(680.0f, 250.0f));
		graphics.SetColor(RGB(255,100,0));
		graphics.DrawString(700, 500, "Game over, you have died and as thus you are");
		graphics.DrawString(700, 520, "reading this screen. If you wish to try again");
		graphics.DrawString(700, 540, "simply press the space bar to reset the game. Yep...");
		graphics.DrawString(700, 560, "why are you still reading this?? I mean I");
		graphics.DrawString(700, 580, "don't care but you are kind of wasting your");
		graphics.DrawString(700, 600, "time at this point.");
		if(Core::Input::IsPressed(32))
		{
			resetFrame();
		}
	}
	if(paused && upgradesPause)
	{
		armorUpgrade.DrawUpgrade(graphics, mouse, 3.0f);
		healthDropUpgrade.DrawUpgrade(graphics, mouse, 3.0f);
		bulletsUpgrade.DrawUpgrade(graphics, mouse, 3.0f);
		fuelUpgrade.DrawUpgrade(graphics, mouse, 3.0f);
	}
	else if(paused && instructionsPause)
	{
		graphics.DrawString(825, 430, "	(Press I to close/open the list of instructions.)");
		graphics.DrawString(800, 450, "	Instructions: use up, down, W or S to move the ship. A and D");
		graphics.DrawString(800, 470, "or left and right to rotate the spaceship. Use the left mouse");
		graphics.DrawString(800, 490, "to fire your turret. Keep in mind that only ten bullets can");
		graphics.DrawString(800, 510, "be on the screen at once and that the sun in the background");
		graphics.DrawString(800, 530, "is simply for ambiance.");
		graphics.DrawString(800, 570, "	Upgrades: Use the cash that you have earned to purchase");
		graphics.DrawString(800, 590, "the upgrades. To open the upgrade menu press R. You can");
		graphics.DrawString(800, 610, "view individual upgrade information by hovering over the tiles.");
		graphics.DrawString(800, 650, "Fueling: Your fuel will slowly decrease as time goes on...because");
		graphics.DrawString(800, 670, "you know.....space....well anyway drive over the aptly named");
		graphics.DrawString(800, 690, "'FUELING STATION' to fuel your ship. You can't, however, fire");
		graphics.DrawString(800, 710, "your turret while you are fueling, because that is illegal.");
		graphics.DrawString(800, 750, "Damage: When an enemy ship collides with you, you'll take");
		graphics.DrawString(800, 770, "some damage. If you have the armor upgrades then your armor");
		graphics.DrawString(800, 790, "will absorb the first chuncks of damage. Each ship has a");
		graphics.DrawString(800, 810, "one second spawn delay from being able to damage your ship");
		graphics.DrawString(800, 830, "as well as a three second delay from the game starting to");
		graphics.DrawString(800, 850, "being able to damage your spacecraft.");
	}

}
示例#28
0
void Upgrade::DrawLetters(Core::Graphics& graphics, float thickness)
{
	char buf[50];
	sprintf_s(buf, "%f", upgradeCost);
	graphics.DrawString(0,0, buf);
	atTheDot = false;
	int currentLetter = 1;
	for(int i=0; i<50; i++)
	{
		if(!atTheDot)
		{
			switch(buf[i])
			{
			case('0'):
				DrawVerticalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap, costPosition.y));
				DrawVerticalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+(Letter_Size-thickness), costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-2*thickness, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+thickness, costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-2*thickness, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+thickness, costPosition.y+(Letter_Size-thickness)));
				currentLetter++;
				break;
			case('1'):
				DrawHorizontalBar(graphics, thickness, (Letter_Size-thickness)/4, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+ (Letter_Size-thickness)/4, costPosition.y+(Letter_Size-thickness)/4));
				DrawVerticalBar(graphics, thickness, Letter_Size-thickness, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+((Letter_Size-thickness)/2), costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness*2,
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+(Letter_Size-thickness)/4, costPosition.y+Letter_Size-thickness));
				currentLetter++;
				break;
			case('2'):
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y + thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+thickness+((Letter_Size-3*thickness)/2)));
				DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y + thickness*2+((Letter_Size-3*thickness)/2)));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+2*thickness + 2*((Letter_Size-3*thickness)/2)));
				currentLetter++;
				break;
			case('3'):
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y + thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+thickness+((Letter_Size-3*thickness)/2)));
				DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y + thickness*2+((Letter_Size-3*thickness)/2)));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+2*thickness + 2*((Letter_Size-3*thickness)/2)));
				currentLetter++;
				break;
			case('4'):
				DrawVerticalBar(graphics, thickness, ((Letter_Size-thickness)/2)+thickness, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap, costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness*2, 
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+thickness, costPosition.y+((Letter_Size-thickness)/2)));
				DrawVerticalBar(graphics, thickness, Letter_Size,
					Vector2D(costPosition.x+currentLetter*Letter_Size+currentLetter*Letter_Gap+(Letter_Size-thickness), costPosition.y));
				currentLetter++;
				break;
			case('5'):
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y + thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+thickness+((Letter_Size-3*thickness)/2)));
				DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y + thickness*2+((Letter_Size-3*thickness)/2)));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+2*thickness + 2*((Letter_Size-3*thickness)/2)));
				currentLetter++;
				break;
			case('6'):
				DrawVerticalBar(graphics, thickness, Letter_Size,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+thickness, costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+thickness, costPosition.y+((Letter_Size-3*thickness)/2)+thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+thickness, costPosition.y+(Letter_Size-3*thickness)+2*thickness));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y+((Letter_Size-3*thickness)/2)+2*thickness));
				currentLetter++;
				break;
			case('7'):
				DrawVerticalBar(graphics, thickness, Letter_Size,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+Letter_Size-thickness, costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				currentLetter++;
				break;
			case('8'):
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y + thickness));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+Letter_Size-thickness, costPosition.y + thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+thickness+((Letter_Size-3*thickness)/2)));
				DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y + thickness*2+((Letter_Size-3*thickness)/2)));
				DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y + thickness*2+((Letter_Size-3*thickness)/2)));
				DrawHorizontalBar(graphics, thickness, Letter_Size, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+2*thickness + 2*((Letter_Size-3*thickness)/2)));
				currentLetter++;
				break;
			case('9'):
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2+2*thickness,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness, 
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+thickness, costPosition.y));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y+thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size-thickness,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+thickness, costPosition.y+((Letter_Size-3*thickness)/2)+thickness));
				DrawHorizontalBar(graphics, thickness, Letter_Size,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter, costPosition.y+(Letter_Size-3*thickness)+2*thickness));
				DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2,
					Vector2D(costPosition.x+Letter_Size*currentLetter+Letter_Gap*currentLetter+(Letter_Size-thickness), costPosition.y+((Letter_Size-3*thickness)/2)+2*thickness));
				currentLetter++;
				break;
			case('.'):
				atTheDot=true;
				break;
			}
		}
	}
}