Untitled

 avatar
unknown
plain_text
a year ago
22 kB
5
Indexable
#include<iostream>
#include<conio.h>
using namespace std;
void clean_and_draw_border(char x[][300])
{

	for (int i = 0; i < 50; i++)
	{
		for (int j = 0; j < 300; j++)
		{
			x[i][j] = ' ';
		}
	}
	for (int i = 1; i < 50; i++)
	{
		x[i][0] = 186;
		x[i][149] = 186;
		x[i][150] = 186;
		x[i][299] = 186;

	}
	for (int i = 1; i < 300; i++)
	{
		x[0][i] = 205;
		x[49][i] = 205;
	}
	x[0][0] = 201;
	x[49][0] = 200;
	x[0][149] = 187;
	x[49][149] = 188;

}
void design_screen_2(char x[][300], int& rl6)
{
	for (int i = rl6; i < 299; i++)
	{
		x[rl6][i] = 205;
	}
}
void draw_bomb_machine(char x[][300], int rmachine, int cmachine)
{
	x[rmachine][cmachine] = '|';
	for (int i = 0; i < 3; i++)
	{
		x[rmachine][cmachine + 1 + i] = '_';
	}
	x[rmachine + 1][cmachine + 4] = '/';
	for (int i = 0; i < 3; i++)
	{
		x[rmachine][cmachine + 8 + i] = '_';
	}
	x[rmachine + 1][cmachine + 8] = '\\';
	x[rmachine][cmachine + 11] = '|';

}
void draw_throw_bomb(char x[][300],int rbomb[], int cbomb[],int n)
{
	x[rbomb[n] + 1][cbomb[n] + 5] = '(';
	x[rbomb[n] + 1][cbomb[n] + 6] = '_';
	x[rbomb[n] + 1][cbomb[n] + 6] = '_';
	x[rbomb[n] + 1][cbomb[n] + 6] = '_';
	x[rbomb[n] + 1][cbomb[n] + 7] = ')';
}
void move_bomb(char x[][300],int rbomb[], int cbomb[], int n)
{
	if (rbomb[n] < 48 && x[rbomb[n] + 1][cbomb[n]] == ' ')
	{
		rbomb[n]++;
	}
}
void cout_to_screen(char x[][300], int l)
{
	system("cls");
	if (l == 1)
	{
		for (int i = 0; i < 50; i++)
		{
			for (int j = 0; j < 150; j++)
			{
				cout << x[i][j];
			}
		}
	}
	if (l == 2)
	{
		for (int i = 0; i < 50; i++)
		{
			for (int j = 150; j < 300; j++)
			{
				cout << x[i][j];
			}
		}
	}
}
void draw_l1(char x[][300], int rl)
{
	for (int i = 1; i < 140; i++)
	{
		x[rl][i] = 205;
	}
	for (int i = 146; i < 149; i++)
	{
		x[rl][i] = 205;
	}
}
void draw_l2(char x[][300], int rl)
{
	for (int i = 148; i > 10; i--)
	{
		x[rl][i] = 205;
	}
	for (int i = 3; i >= 1; i--)
	{
		x[rl][i] = 205;
	}

}
void draw_ladder(char x[][300], int rladder, int cladder, int rl)
{
	for (int i = rladder; i < rl; i++)
	{
		x[i][140] = '|';
		x[i][146] = '|';
		for (int c = cladder + 1; c < 146; c++)
		{
			x[i][c] = '-';
		}

	}
}
void draw_ladder2(char x[][300], int rladder, int cladder, int rl)
{
	for (int i = rladder; i < rl; i++)
	{
		x[i][10] = '|';
		x[i][3] = '|';
		for (int c = cladder - 1; c > 3; c--)
		{
			x[i][c] = '-';
		}

	}

}
void draw_elevator(char x[][300], int celevator, int relevator)
{
	int r = relevator;
	for (int c = celevator; c > 3; c--)
	{
		x[r][c] = '-';
	}

}
void move_elevator(int& relevator, int& dir)
{
	if (dir == 1)
	{
		if (relevator + 1 == 40)
		{
			dir = -1;
		}
	}
	if (dir == -1)
	{
		if (relevator == 32)
		{
			dir = 1;
		}
	}
	relevator += dir;

}
void draw_enemy(char x[][300], int enemyr, int enemyc, int dire)
{
	if (dire == 1)
	{
		x[enemyr][enemyc] = '|';
		x[enemyr][enemyc + 1] = '_';
		x[enemyr][enemyc + 2] = '|';
		x[enemyr][enemyc + 3] = '_';
		x[enemyr - 1][enemyc] = '|';
		x[enemyr - 1][enemyc + 1] = '_';
		x[enemyr - 1][enemyc + 2] = '|';
		x[enemyr - 1][enemyc - 1] = '/';
		for (int i = 0; i < 4; i++)
		{
			x[enemyr - 2][enemyc + i] = '_';
		}
		for (int i = 0; i < 2; i++)
		{
			x[enemyr - 2 - i][enemyc - 1] = '|';
		}
		for (int i = 0; i < 2; i++)
		{
			x[enemyr - 2 - i][enemyc + 4] = '|';
		}
		x[enemyr - 3][enemyc + 3] = '0';
		x[enemyr - 3][enemyc + 1] = '0';
		for (int i = 0; i < 6; i++)
		{
			x[enemyr - 4][enemyc - 1 + i] = '_';
		}
		x[enemyr - 2][enemyc + 5] = '_';
		x[enemyr - 2][enemyc + 6] = 209;
		x[enemyr - 2][enemyc + 7] = 196;
		for (int i = 0; i < 6; i++)
		{
			x[enemyr - 5][enemyc - 1 + i] = 254;
		}
	}
	else
	{
		x[enemyr][enemyc] = '_';
		x[enemyr][enemyc + 1] = '|';
		x[enemyr][enemyc + 2] = '_';
		x[enemyr][enemyc + 3] = '|';
		x[enemyr - 1][enemyc + 1] = '|';
		x[enemyr - 1][enemyc + 2] = '_';
		x[enemyr - 1][enemyc + 3] = '|';
		x[enemyr - 1][enemyc + 4] = '\\';
		x[enemyr - 2][enemyc - 1] = '_';
		x[enemyr - 2][enemyc] = '|';
		for (int i = 0; i < 4; i++)
		{
			x[enemyr - 2][enemyc + 1 + i] = '_';
		}
		x[enemyr - 2][enemyc - 2] = 209;
		x[enemyr - 2][enemyc - 3] = 196;
		x[enemyr - 2][enemyc + 5] = '|';
		x[enemyr - 3][enemyc] = '|';
		x[enemyr - 3][enemyc + 5] = '|';
		for (int i = 0; i < 6; i++)
		{
			x[enemyr - 4][enemyc + i] = '_';
		}
		x[enemyr - 3][enemyc + 1] = '0';
		x[enemyr - 3][enemyc + 3] = '0';
		for (int i = 0; i < 6; i++)
		{
			x[enemyr - 5][enemyc + i] = 254;
		}

	}
}
void move_enemy(int& enemyc, int& dire)
{
	if (dire == 1)
	{
		if (enemyc == 136)
		{
			dire = -1;
		}
	}
	if (dire == -1)
	{
		if (enemyc == 15)
		{
			dire = 1;
		}
	}
	enemyc += dire;
}

void fire(char x[][300], int rfire, int cfire)
{
	for (int c = cfire; c < 110; c++)
	{
		x[rfire][c] = '*';
		x[rfire - 1][c] = '*';
	}
}
void draw_selim(char x[][300], int rselim, int cselim)
{
	x[rselim][cselim] = '=';
	x[rselim][cselim + 1] = '=';
	x[rselim][cselim + 2] = '=';
	x[rselim][cselim + 3] = '=';
	x[rselim][cselim + 4] = '=';
	x[rselim][cselim + 5] = '=';
	x[rselim][cselim + 6] = '=';
}
void move_selim(char x[][300], int& rselim, int& cselim, int& dirs)
{
	if (dirs == 1)
	{
		if (cselim + 5 == 75)
		{
			dirs = -1;
		}
	}
	if (dirs == -1)
	{
		if (cselim == 30)
		{
			dirs = 1;
		}
	}
	cselim += dirs;
}
void draw_slm(char x[][300], int rslm, int cslm)
{
	x[rslm][cslm] = '=';
	x[rslm][cslm + 1] = '=';
	x[rslm][cslm + 2] = '=';
	x[rslm][cslm + 3] = '=';
	x[rslm][cslm + 4] = '=';
	x[rslm][cslm + 5] = '=';
	x[rslm][cslm + 6] = '=';
}
void move_slm(char x[][300], int& rslm, int& cslm, int& dirss)
{
	if (dirss == 1)
	{
		if (cslm - 5 == 71)
		{
			dirss = -1;
		}
	}
	if (dirss == -1)
	{
		if (cslm == 115)
		{
			dirss = 1;
		}
	}
	cslm -= dirss;
}
void draw_gun_up(char x[][300], int rgun, int cgun)
{
	x[rgun][cgun] = 'O';
}
void draw_zombie(char x[][300], int rzombie, int czombie, int dirz)
{
	if (dirz == 2)
	{
		x[rzombie][czombie] = '_';
		x[rzombie][czombie + 1] = '_';
		x[rzombie - 1][czombie] = '|';
		x[rzombie][czombie + 4] = '_';
		x[rzombie][czombie + 5] = '_';
		x[rzombie - 1][czombie + 4] = '|';
		x[rzombie - 2][czombie] = '|';
		x[rzombie - 2][czombie + 4] = '|';
		x[rzombie - 2][czombie + 1] = 170;
		x[rzombie - 2][czombie + 5] = 170;
		x[rzombie - 3][czombie] = '|';
		x[rzombie - 3][czombie + 3] = '|';
		x[rzombie - 4][czombie + 1] = 'o';
		x[rzombie - 4][czombie + 2] = 'o';
		x[rzombie - 3][czombie + 1] = '-';
		x[rzombie - 3][czombie + 2] = '-';
		for (int i = 0; i < 4; i++)
		{
			x[rzombie - 5][czombie + i] = 254;
		}
	}
	if (dirz == -2)
	{
		x[rzombie][czombie] = '_';
		x[rzombie][czombie - 1] = '_';
		x[rzombie - 1][czombie] = '|';
		x[rzombie][czombie - 4] = '_';
		x[rzombie][czombie - 5] = '_';
		x[rzombie - 1][czombie - 4] = '|';
		x[rzombie - 1][czombie - 4] = '|';
		x[rzombie - 2][czombie] = '|';
		x[rzombie - 2][czombie - 4] = '|';
		x[rzombie - 2][czombie - 1] = 169;
		x[rzombie - 2][czombie - 5] = 169;
		x[rzombie - 3][czombie] = '|';
		x[rzombie - 3][czombie - 3] = '|';
		x[rzombie - 4][czombie - 1] = 'o';
		x[rzombie - 4][czombie - 2] = 'o';
		x[rzombie - 3][czombie - 1] = '-';
		x[rzombie - 3][czombie - 2] = '-';
		for (int i = 0; i < 4; i++)
		{
			x[rzombie - 5][czombie - i] = 254;
		}

	}
}
void move_zombie(int& czombie, int& dirz)
{
	if (dirz == 2)
	{
		if (czombie + 16 == 148)
		{
			dirz = -2;
		}
	}
	if (dirz == -2)
	{
		if (czombie == 20)
		{
			dirz = 2;
		}
	}
	czombie += dirz;
}
void draw_laser(char x[][300], int rlaser, int claser)
{
	x[rlaser][claser] = '_';
	x[rlaser][claser + 1] = '|';
	x[rlaser - 1][claser + 1] = '/';
	x[rlaser - 2][claser + 1] = '\\';
	x[rlaser - 3][claser + 1] = '|';
	x[rlaser - 4][claser] = '_';
}
void laser_attack(char x[][300], int rlaser, int claser, int& ct)
{
	if (ct == 0)
	{
		x[rlaser - 1][claser + 1] = ' ';
		x[rlaser - 2][claser + 1] = ' ';
		x[rlaser - 1][claser + 1] = '_';
		x[rlaser - 3][claser + 1] = '_';
		ct = 10;
		for (int i = 1; i < 137; i++)
		{
			x[rlaser - 2][claser + i] = '_';
		}
	}
}
void laser_kill_hero(char x[][300], int& rhero, int& chero, int& flaser, int& polr, int& polc, int& newposr, int& newposc)
{
	if (rhero == polr)
	{
		if (x[rhero - 3][chero] == '_')
		{
			rhero = 7;
			chero = 1;
		}
	}
}
void draw_hero(char x[][300], int rhero, int chero, int gunf, int bulletf, int& rbullet, int& cbullet, int bullet[], int h, int direh)
{


	if (gunf == 0)
	{
		if (direh == 0)
		{
			x[rhero][chero] = '|';
			x[rhero][chero + 1] = '_';
			x[rhero][chero + 2] = '|';
			x[rhero][chero + 3] = '_';
			x[rhero - 1][chero] = '|';
			x[rhero - 1][chero + 1] = '_';
			x[rhero - 1][chero + 2] = '|';
			x[rhero - 1][chero - 1] = '/';
			for (int i = 0; i < 4; i++)
			{
				x[rhero - 2][chero + i] = '_';
			}
			for (int i = 0; i < 2; i++)
			{
				x[rhero - 2 - i][chero - 1] = '|';
			}
			for (int i = 0; i < 2; i++)
			{
				x[rhero - 2 - i][chero + 4] = '|';
			}
			x[rhero - 3][chero + 3] = '0';
			x[rhero - 3][chero + 1] = '0';
			for (int i = 0; i < 6; i++)
			{
				x[rhero - 4][chero - 1 + i] = '_';
			}
			x[rhero - 1][chero + 3] = '\\';
			//x[rhero - 2][chero + 6] = 209;
			//x[rhero - 2][chero + 7] = 196;
		}
		if (direh == 1)
		{
			x[rhero][chero] = '_';
			x[rhero][chero + 1] = '|';
			x[rhero][chero + 2] = '_';
			x[rhero][chero + 3] = '|';
			x[rhero - 1][chero + 1] = '|';
			x[rhero - 1][chero + 2] = '_';
			x[rhero - 1][chero + 3] = '|';
			x[rhero - 1][chero + 4] = '\\';
			x[rhero - 1][chero] = '/';
			x[rhero - 2][chero] = '|';
			for (int i = 0; i < 4; i++)
			{
				x[rhero - 2][chero + 1 + i] = '_';
			}
			x[rhero - 2][chero + 5] = '|';
			x[rhero - 3][chero] = '|';
			x[rhero - 3][chero + 5] = '|';
			for (int i = 0; i < 6; i++)
			{
				x[rhero - 4][chero + i] = '_';
			}
			x[rhero - 3][chero + 1] = '0';
			x[rhero - 3][chero + 3] = '0';

		}
	}
	if (gunf == 1)
	{
		if (direh == 0)
		{
			x[rhero][chero] = '|';
			x[rhero][chero + 1] = '_';
			x[rhero][chero + 2] = '|';
			x[rhero][chero + 3] = '_';
			x[rhero - 1][chero] = '|';
			x[rhero - 1][chero + 1] = '_';
			x[rhero - 1][chero + 2] = '|';
			x[rhero - 1][chero - 1] = '/';
			for (int i = 0; i < 4; i++)
			{
				x[rhero - 2][chero + i] = '_';
			}
			for (int i = 0; i < 2; i++)
			{
				x[rhero - 2 - i][chero - 1] = '|';
			}
			for (int i = 0; i < 2; i++)
			{
				x[rhero - 2 - i][chero + 4] = '|';
			}
			x[rhero - 3][chero + 3] = '0';
			x[rhero - 3][chero + 1] = '0';
			for (int i = 0; i < 6; i++)
			{
				x[rhero - 4][chero - 1 + i] = '_';
			}
			x[rhero - 2][chero + 5] = '_';
			x[rhero - 2][chero + 6] = 209;
			x[rhero - 2][chero + 7] = 196;
		}
		if (direh == 1)
		{
			x[rhero][chero] = '_';
			x[rhero][chero + 1] = '|';
			x[rhero][chero + 2] = '_';
			x[rhero][chero + 3] = '|';
			x[rhero - 1][chero + 1] = '|';
			x[rhero - 1][chero + 2] = '_';
			x[rhero - 1][chero + 3] = '|';
			x[rhero - 1][chero + 4] = '\\';
			x[rhero - 2][chero - 1] = '_';
			x[rhero - 2][chero - 2] = 209;
			x[rhero - 2][chero - 3] = 196;
			x[rhero - 2][chero] = '|';
			for (int i = 0; i < 4; i++)
			{
				x[rhero - 2][chero + 1 + i] = '_';
			}
			x[rhero - 2][chero + 5] = '|';
			x[rhero - 3][chero] = '|';
			x[rhero - 3][chero + 5] = '|';
			for (int i = 0; i < 6; i++)
			{
				x[rhero - 4][chero + i] = '_';
			}
			x[rhero - 3][chero + 1] = '0';
			x[rhero - 3][chero + 3] = '0';

		}


	}

}

void move_hero(char x[][300], char dirh, int& rhero, int& chero, int& f, int& gunf, int& rbullet, int& cbullet)
{
	int posr = 7;
	int posc = 1;
	int flag = 1;
	if (dirh == 'd')
	{
		if (x[rhero][chero + 4] == ' ' || x[rhero][chero + 3] == '|' || x[rhero][chero + 3] == '-')
		{
			chero++;
		}
		if (x[rhero][chero + 3] == '*')
		{
			flag = 0;
		}
		if (flag == 0)
		{
			rhero = posr;
			chero = posc;
		}
		if (x[rhero - 1][chero + 5] == 'O')
		{

			gunf = 1;
			x[6][10] = ' ';
		}
	}
	if (dirh == 'a')
	{
		if (x[rhero][chero - 1] == ' ' || x[rhero][chero - 1] == '|' || x[rhero][chero - 1] == '-')
		{
			chero--;
		}
	}
	if (dirh == 'q')
	{
		if (x[rhero - 5][chero - 2] == ' ' || x[rhero - 5][chero - 2] == '|' || x[rhero - 5][chero - 2] == '-')
		{
			if (f == 1)
			{
				rhero -= 3;
				chero -= 2;

			}

		}
	}
	if (dirh == 'e')
	{
		if (x[rhero - 5][chero + 1] == ' ' || x[rhero - 5][chero + 1] == '|' || x[rhero - 5][chero + 1] == '-')
		{
			if (f == 1)
			{
				f++;
				rhero -= 3;
				chero += 2;

			}
		}

	}
	if (dirh == 'w')
	{
		if (x[rhero + 3][chero] == ' ' || x[rhero + 3][chero] == '-')
		{
			if (f == 1)
			{
				f++;
				rhero -= 3;

			}
		}

	}
	if (dirh == 's')
	{
		if (x[rhero + 1][chero] == '-')
		{
			rhero++;
		}
	}

}
void _gravity(char x[][300], int& rhero, int& chero)
{
	if (x[rhero + 1][chero] == ' ' && x[rhero + 1][chero + 1] == ' ' && x[rhero + 1][chero + 2] == ' ')
	{
		rhero++;
	}
}
void move_hero_on_platform(char x[][300], int& dir, int& rhero, int& chero)
{

	if (x[rhero + 1][chero + 1] == '=' || x[rhero + 1][chero] == '=' || x[rhero + 1][chero + 2] == '=')
	{
		if (dir == 1)
		{
			chero++;
		}
		if (dir == -1)
		{
			chero--;
		}
	}
}
void fire_kill_hero(char x[][300], int& rhero, int& chero)
{
	if (x[rhero + 1][chero] == ' ' || x[rhero + 1][chero + 1] == x[rhero + 1][chero + 2] == '*')
	{
		rhero = 7;
		chero = 1;
	}
}
void zombie_kill_hero(char x[][300], int& rhero, int& chero, int& zombief, int& poszr, int& poszc)
{
	if (x[rhero][chero - 2] == '_')
	{
		zombief = 1;
	}
	if (zombief == 1)
	{
		rhero = poszr;
		chero = poszc;
	}
}


void draw_bullet(char x[][300], int& rbullet, int& cbullet, int& gunf, int& bulletf, int bullet[], int h, int gunct, int bullethit[])
{
	if (bulletf == 1)
	{
		if (bullethit[0] != 1)
		{
			if (gunct >= 1)
			{
				x[bullet[0]][bullet[1]] = 'o';
			}
		}
		if (bullethit[1] != 1)
		{
			if (gunct >= 2)
			{
				x[bullet[2]][bullet[3]] = 'o';
			}
		}
		if (bullethit[2] != 1)
		{
			if (gunct >= 3)
			{
				x[bullet[4]][bullet[5]] = 'o';
			}
		}
		if (bullethit[3] != 1)
		{
			if (gunct >= 4)
			{
				x[bullet[6]][bullet[7]] = 'o';
			}
		}
		if (bullethit[4] != 1)
		{
			if (gunct >= 5)
			{
				x[bullet[8]][bullet[9]] = 'o';
			}
		}
	}
}
void move_bullet(char x[][300], int& cbullet, int rbullet, int& bulletf, int bullet[], int h, int gunct, int bullethit[], int direh, int bulletmove[])
{
	if (direh == 0)
	{
		if (bulletf == 1)
		{
			if (gunct >= 1)
			{
				if (x[bullet[0]][bullet[1]] == ' ')
				{
					bullet[1] = bullet[1] + bulletmove[0];
				}
				else
				{
					bullethit[1] = 1;
				}
			}
			if (gunct >= 2)
			{
				if (x[bullet[2]][bullet[3]] == ' ')
				{
					bullet[3] = bullet[3] + bulletmove[1];
				}
				else
				{
					bullethit[2] = 1;
				}
			}
			if (gunct >= 3)
			{
				if (x[bullet[4]][bullet[5]] == ' ')
				{
					bullet[5] = bullet[5] + bulletmove[2];
				}
				else
				{
					bullethit[3] = 1;
				}
			}
			if (gunct >= 4)
			{
				if (x[bullet[6]][bullet[7]] == ' ')
				{
					bullet[7] = bullet[7] + bulletmove[3];
				}
				else
				{
					bullethit[4] = 1;
				}
			}
			if (gunct >= 5)
			{
				if (x[bullet[8]][bullet[9]] == ' ')
				{
					bullet[9] = bullet[9] + bulletmove[4];
				}
				else
				{
					bullethit[5] = 1;
				}
			}


		}
	}
	if (direh == 1)
	{
		if (bulletf == 1)
		{
			if (gunct >= 1)
			{
				if (x[bullet[0]][bullet[1]] == ' ')
				{
					bullet[1] = bullet[1] + bulletmove[0];
				}
				else
				{
					bullethit[0] = 1;
				}
			}
			if (gunct >= 2)
			{
				if (x[bullet[2]][bullet[3]] == ' ')
				{
					bullet[3] = bullet[3] + bulletmove[1];
				}
				else
				{
					bullethit[1] = 1;
				}
			}
			if (gunct >= 3)
			{
				if (x[bullet[4]][bullet[5]] == ' ')
				{
					bullet[5] = bullet[5] + bulletmove[2];
				}
				else
				{
					bullethit[2] = 1;
				}
			}
			if (gunct >= 4)
			{
				if (x[bullet[6]][bullet[7]] == ' ')
				{
					bullet[7] = bullet[7] + bulletmove[3];
				}
				else
				{
					bullethit[3] = 1;
				}
			}
			if (gunct >= 5)
			{
				if (x[bullet[8]][bullet[9]] == ' ')
				{
					bullet[9] = bullet[9] + bulletmove[4];
				}
				else
				{
					bullethit[4] = 1;
				}
			}


		}
	}
}
void draw_stats(char x[][300], int hlr, int hlc)
{
	x[hlr][hlc] = 'H';
	x[hlr][hlc + 1] = 'E';
	x[hlr][hlc + 2] = 'A';
	x[hlr][hlc + 3] = 'L';
	x[hlr][hlc + 4] = 'T';
	x[hlr][hlc + 5] = 'H';
	x[hlr][hlc + 6] = '=';
	x[hlr][hlc + 7] = 003;
	x[hlr][hlc + 8] = 003;
	x[hlr][hlc + 9] = 003;
	x[hlr][hlc + 12] = 'B';
	x[hlr][hlc + 13] = 'U';
	x[hlr][hlc + 14] = 'L';
	x[hlr][hlc + 15] = 'L';
	x[hlr][hlc + 16] = 'E';
	x[hlr][hlc + 17] = 'T';
	x[hlr][hlc + 18] = '=';
	x[hlr][hlc + 19] = '5';
}

void main()
{
	char x[50][300];
	int rbomb[5];
	int cbomb[5];
	int l = 2;
	int hlr = 45;
	int hlc = 2;
	int hlr2 = 1;
	int hlc2 = 155;
	int rl1 = 8;
	int rl2 = 16;
	int rl3 = 24;
	int rl4 = 32;
	int rl5 = 40;
	int rladder = 8;
	int cladder = 140;
	int rladder2 = 16;
	int cladder2 = 10;
	int rladder3 = 24;
	int cladder3 = 140;
	int relevator = 32;
	int celevator = 10;
	int dir = 1;
	int enemyr = 23;
	int enemyc = 109;
	int dire = 1;
	int rfire = 7;
	int cfire = 40;
	int rselim = 5;
	int cselim = 35;
	int dirs = 1;
	int rslm = 5;
	int cslm = 110;
	int dirss = 1;
	int rgun = 6;
	int cgun = 10;
	int rzombie = 15;
	int czombie = 100;
	int zombief = -1;
	int poszr = 7;
	int poszc = 1;
	int dirz = 2;
	int dirz2 = 2;
	int dirz3 = 2;
	int rzombie2 = 15;
	int czombie2 = 70;
	int rzombie3 = 15;
	int czombie3 = 40;
	int rlaser = 30;
	int claser = 1;
	int flaser = 0;
	int polr = 31;
	int polc = 139;
	int newposr = 7;
	int newposc = 1;
	int ct = 10;
	int rhero = 7;
	int chero = 5;
	char dirh;
	int gunf = 0;
	int posgr = 0;
	int posgc = 0;
	int bulletf = 0;
	int rbullet;
	int cbullet;
	int bullet[10];
	int h = -2;
	int gunct = 0;
	int bullethit[5];
	int direh = 0;
	int p = -1;
	int bulletmove[5];
	int rmachine = 4;
	int cmachine = 220;
	int rmachine2 = 4;
	int cmachine2 = 170;
	int rmachine3 = 4;
	int cmachine3 = 250;
	int rmachine4 = 4;
	int cmachine4 = 270;
	int n = 0;
	int n2 = 1;
	int n3 = 2;
	int n4 = 3;
	int rl6 = 40;
	int rl7 = 3;
	rbomb[0] = rmachine;
	cbomb[0] = cmachine;
	rbomb[1] = rmachine2;
	cbomb[1] = cmachine2;
	rbomb[2] = rmachine3;
	cbomb[2] = cmachine3;
	rbomb[3] = rmachine4;
	cbomb[3] = cmachine4;
	for (;;)
	{
		for (; !_kbhit();)
		{
			ct--;
			clean_and_draw_border(x);
			draw_l1(x, rl1);
			draw_l2(x, rl2);
			draw_l1(x, rl3);
			draw_l2(x, rl4);
			draw_l1(x, rl5);
			draw_ladder(x, rladder, cladder, rl2);
			draw_ladder2(x, rladder2, cladder2, rl3);
			draw_ladder(x, rladder3, cladder3, rl4);
			draw_elevator(x, celevator, relevator);
			move_elevator(relevator, dir);
			draw_enemy(x, enemyr, enemyc, dire);
			move_enemy(enemyc, dire);
			fire(x, rfire, cfire);
			move_selim(x, rselim, cselim, dirs);
			draw_selim(x, rselim, cselim);
			draw_slm(x, rslm, cslm);
			move_slm(x, rslm, cslm, dirss);
			draw_gun_up(x, rgun, cgun);
			draw_zombie(x, rzombie, czombie, dirz);
			draw_zombie(x, rzombie2, czombie2, dirz2);
			draw_zombie(x, rzombie3, czombie3, dirz3);
			move_zombie(czombie, dirz);
			move_zombie(czombie2, dirz2);
			move_zombie(czombie3, dirz3);
			draw_laser(x, rlaser, claser);
			laser_attack(x, rlaser, claser, ct);
			draw_hero(x, rhero, chero, gunf, bulletf, rbullet, cbullet, bullet, h, direh);
			_gravity(x, rhero, chero);
			move_hero_on_platform(x, dirs, rhero, chero);
			//fire_kill_hero(x, rhero, chero);
			zombie_kill_hero(x, rhero, chero, zombief, poszr, poszc);
			move_bullet(x, cbullet, rbullet, bulletf, bullet, h, gunct, bullethit, direh, bulletmove);
			draw_bullet(x, rbullet, cbullet, gunf, bulletf, bullet, h, gunct, bullethit);
			laser_kill_hero(x, rhero, chero, flaser, polr, polc, newposr, newposc);
			draw_stats(x, hlr, hlc);
			draw_stats(x, hlr2, hlc2);
			draw_bomb_machine(x, rmachine, cmachine);
			draw_bomb_machine(x, rmachine2, cmachine2);
			draw_bomb_machine(x, rmachine3, cmachine3);
			draw_bomb_machine(x, rmachine4, cmachine4);
			draw_throw_bomb(x, rbomb, cbomb,n);
			draw_throw_bomb(x, rbomb, cbomb,n2);
			draw_throw_bomb(x, rbomb, cbomb, n3);
			draw_throw_bomb(x, rbomb, cbomb, n4);
			move_bomb(x, rbomb, cbomb, n);
			move_bomb(x, rbomb, cbomb, n2);
			move_bomb(x, rbomb, cbomb, n3);
			move_bomb(x, rbomb, cbomb, n4);
			design_screen_2(x, rl6);
			design_screen_2(x, rl7);
			cout_to_screen(x, l);
			if (rbomb[0] + 3 != ' ')
			{
				rbomb[0] = rmachine;
				cbomb[0] = cmachine;
			}
			if (rbomb[1] + 3 != ' ')
			{
				rbomb[1] = rmachine2;
				cbomb[1] = cmachine2;
			}
			if (rbomb[2] + 3 != ' ')
			{
				rbomb[2] = rmachine3;
				cbomb[2] = cmachine3;
			}
			if (rbomb[3] + 3 != ' ')
			{
				rbomb[3] = rmachine4;
				cbomb[3] = cmachine4;
			}

		}
		int f = 0;
		dirh = _getch();
		if (dirh == 'q')
		{
			f = 1;
		}
		if (dirh == 'e')
		{
			f = 1;
		}
		if (dirh == 'w')
		{
			f = 1;
		}
		if (dirh == 'd')
		{
			direh = 0;
		}
		if (dirh == 'a')
		{
			direh = 1;
		}
		if (dirh == 'f')
		{
			if (gunf == 1)
			{
				gunct++;
				h = h + 2;
				bulletf = 1;
				p++;
				if (direh == 0)
				{
					bullet[h] = rhero - 2;
					bullet[h + 1] = chero + 8;
					bulletmove[p] = 1;
				}
				if (direh == 1)
				{
					bullet[h] = rhero - 2;
					bullet[h + 1] = chero - 4;
					bulletmove[p] = -1;
				}
			}
		}
		if (ct >= 1)
		{
			draw_bullet(x, rbullet, cbullet, gunf, bulletf, bullet, h, gunct, bullethit);
		}
		if (ct >= 2)
		{
			draw_bullet(x, rbullet, cbullet, gunf, bulletf, bullet, h, gunct, bullethit);
		}
		if (ct >= 3)
		{
			draw_bullet(x, rbullet, cbullet, gunf, bulletf, bullet, h, gunct, bullethit);
		}
		if (ct >= 4)
		{
			draw_bullet(x, rbullet, cbullet, gunf, bulletf, bullet, h, gunct, bullethit);
		}
		if (ct >= 5)
		{
			draw_bullet(x, rbullet, cbullet, gunf, bulletf, bullet, h, gunct, bullethit);
		}
		move_hero(x, dirh, rhero, chero, f, gunf, rbullet, cbullet);
		draw_hero(x, rhero, chero, gunf, bulletf, rbullet, cbullet, bullet, h, direh);
	}
}
Editor is loading...
Leave a Comment