C++本身不支持可视化,但是植入easyx这个可视化库以后可以实现可视化
(闯关模式还没做好)
全部代码:
#include<graphics.h>
#include<conio.h>
#include <stdlib.h>
#include <time.h>
#include<CString>
#include <Windows.h>
#include <mmsystem.h>
#include<iostream>
#include<stdio.h>
#pragma comment(lib,"Winmm.lib")
using namespace std;
void puthp();
struct player
{
char name[50];
int hp;
int ka;
int kd;
int im;
}p[3];
void backg()
{
cleardevice();
settextcolor(BLACK);
setbkmode(TRANSPARENT);
}
void putch(char tar[],int x,int y,int w,int h)
{
int rx,ry;
rx=x-w/2;
ry=y-h/2;
outtextxy(rx,ry,tar);
}
void chara(int num,int m)
{
if(m==1)
{
if(num==1)
{
IMAGE JAP;
loadimage(&JAP, "res\\1.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==2)
{
circle(100,100,30);
line(100,130,100,190);
line(100,190,50,230);
line(100,190,150,230);
line(100,160,130,160);
line(100,160,145,90);
}
if(num==3)
{
IMAGE JAP;
loadimage(&JAP, "res\\3.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==4)
{
IMAGE JAP;
loadimage(&JAP, "res\\4.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==5)
{
IMAGE JAP;
loadimage(&JAP, "res\\5.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==6)
{
IMAGE JAP;
loadimage(&JAP, "res\\6.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==7)
{
IMAGE JAP;
loadimage(&JAP, "res\\7.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==8)
{
IMAGE JAP;
loadimage(&JAP, "res\\8.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==9)
{
IMAGE JAP;
loadimage(&JAP, "res\\9.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==10)
{
IMAGE JAP;
loadimage(&JAP, "res\\10.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==11)
{
IMAGE JAP;
loadimage(&JAP, "res\\11.jpg",100,100);
putimage(70,90,&JAP);
}
if(num==12)
{
IMAGE JAP;
loadimage(&JAP, "res\\12.jpg",100,100);
putimage(70,90,&JAP);
}
}
if(m==2)
{
if(num==2)
{
circle(500,100,30);
line(500,130,500,190);
line(500,190,450,230);
line(500,190,550,230);
line(500,160,430,160);
line(500,160,540,210);
}
if(num==1)
{
IMAGE JAP;
loadimage(&JAP, "res\\1.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==3)
{
IMAGE JAP;
loadimage(&JAP, "res\\3.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==4)
{
IMAGE JAP;
loadimage(&JAP, "res\\4.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==5)
{
IMAGE JAP;
loadimage(&JAP, "res\\5.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==6)
{
IMAGE JAP;
loadimage(&JAP, "res\\6.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==7)
{
IMAGE JAP;
loadimage(&JAP, "res\\7.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==8)
{
IMAGE JAP;
loadimage(&JAP, "res\\8.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==9)
{
IMAGE JAP;
loadimage(&JAP, "res\\9.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==10)
{
IMAGE JAP;
loadimage(&JAP, "res\\10.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==11)
{
IMAGE JAP;
loadimage(&JAP, "res\\11.jpg",100,100);
putimage(500,90,&JAP);
}
if(num==12)
{
IMAGE JAP;
loadimage(&JAP, "res\\12.jpg",100,100);
put