#include <iostream>
#include <conio.h>
#include <string>
#include <map>
#include <cmath>
#include <windows.h>
#include <time.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int fallspeed;
int jumpspeed = -3;
int gravity = 1;
int y = 400, x = 500;
int restartposy, restartposx, face, health = 1000, lasthealth = 1000, breath = 100, hungry = 1000, dienum;
bool attack, defense, hurt, mode;
struct TNT {
int y;
int x;
int time;
bool issave;
};
struct BLOCK {
int color;
string ch;
string type;
};
struct MOB {
int fallspeed;
int health;
bool hurt;
int y;
int x;
int attack;
string shap;
bool isenemy;
int color;
string name;
};
struct ARROW {
string shap;
double y;
double x;
double fallspeed;
double plusx;
};
TNT tnt[20];
string die;
ARROW arrow[100];
MOB mobs[50] = {
{0, 1000, 0, 0, 0, 100, "危", true, 7, "危"},
{0, 10, 0, 0, 0, 10, " ", true, 7, " "},
{0, 1000, 0, 0, 0, 100, "MM", false, 7, "MM"},
};
BLOCK block[32] = {
{0, " ", "air"},
{6, "██", "block"},
};
int board[1005][1005];
int setboard[1005][1005];
int bag[100];
void color(int a) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), a);
}
int init() {
for (int j = 0; j < 100; j++) {
bag[j] = 0;
}
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1000; j++) {
board[i][j] = 0;
}
}
double lasty = rand() % 101 + 400;
for (int i = 5; i < 1000; i += 5) {
double y = rand() % 21 - 10 + lasty;
y = min(450.0, y);
double high = lasty;
int dirt = rand() % 5 + 2;
for (int j = i - 5; j < i; j++) {
high += (y - lasty) / 5;
for (int k = 999; k >= (int)high; k--) {
if (k == (int)high) {
setboard[k][j] = 3;
if (high <= 350) {
setboard[k][j] = 4;
}
} else if (k - dirt <= (int)high) {
setboard[k][j] = 1;
} else {
setboard[k][j] = 2;
}
}
}
lasty = y;
}
return 0;
}
int main() {
srand((int)time(0));
for (int i = 0; i < 20; i++) {
tnt[i].time = -2;
}
init();
while (1) {
system("cls");
Sleep(30);
}
return 0;
}