示例#1
0
void MainLoop()
{
	int x, y;
	for (x = 0; x < 800; x+=256)
	{
		for (y = 0; y < 600; y+=256)
		{
			graphics.DrawImage2D(x, y, 256, 256, block_floor); //Draw floor blocks
		}
	}

	graphics.DrawImage2D(car_x, car_y, 128, 128, car[car_direction]); //Draw car
}
示例#2
0
void MainLoop()
{
	int x, y;
    for (x = camera_position - 18; x < camera_position + 18; x++)
	{
		for (y = 0; y < 25; y++)
		{
			if (Mapa[x][y] == 'G')
			{
				graphics.DrawImage2D(((x - (camera_position - 18))*24),y*24, 24, 24, block_glass);
			}
			if (Mapa[x][y] == 'T')
			{
				graphics.DrawImage2D(((x - (camera_position - 18))*24),y*24, 24, 24, block_terrain);
			}
		}
	}
}