#pragma warning(default: 4996)//取消因为旧版本函数而报错的问题
#include <graphics.h>
#include <iostream>
#include <graphics.h>
#include <conio.h>
#include <Windows.h>
#include<conio.h>
#pragma comment(lib,"Winmm.lib")
#include<windows.h>
#include<stdio.h>
int player1_x, player1_y, player2_x, player2_y, player1old_y, player2old_y, player1old_x, player2old_x;//flagK判断是否跳跃;flagAD中 |2:按下D |1:面向右 |-2:按下A |-1:面向左
IMAGE img_bk, img_blood2, img_blood1, img_blood, img_blood_head_left2, img_blood_head_left1, img_blood_head_right2, img_blood_head_right1;
IMAGE img_player1walk1, img_player1walk2, img_player1jp1, img_player1jp2, img_player1df1, img_player1df2, img_player1ft11, img_player1ft12, img_player1ft21, img_player1ft22, img_player1ft31, img_player1ft32, img_player1jf1, img_player1jf2, img_player1dg1, img_player1dg2, img_player1sk11, img_player1sk12, img_player1bt1, img_player1bt2, img_player1sk21, img_player1sk22, img_player1sk31, img_player1sk32;
IMAGE img_player2walk1, img_player2walk2, img_player2jp1, img_player2jp2, img_player2df1, img_player2df2, img_player2ft11, img_player2ft12, img_player2ft21, img_player2ft22, img_player2ft31, img_player2ft32, img_player2jf1, img_player2jf2, img_player2dg1, img_player2dg2, img_player2sk11, img_player2sk12, img_player2bt1, img_player2bt2, img_player2sk21, img_player2sk22, img_player2sk31, img_player2sk32;
IMAGE img_bk1; // 背景1
IMAGE img_chosehero;//背景2
IMAGE img_head[50];//头像数组
IMAGE img_player11, img_player12, img_player21, img_player22;//选框
IMAGE img_ESC;//暂停界面
IMAGE img[8]; IMAGE imgy[8];
IMAGE img_std[4]; IMAGE imgy_std[4];
IMAGE img_dash[4]; IMAGE imgy_dash[4];
IMAGE img_fire[9]; IMAGE imgy_fire[9];
IMAGE img_obfire[3]; IMAGE imgy_obfire[3];
IMAGE img_obto[3]; IMAGE imgy_obto[3];
IMAGE img_obtofire[7]; IMAGE imgy_obtofire[7];
IMAGE img_ground[6]; IMAGE imgy_ground[6];
//可移动背景的相关定义
struct bk {
//背景从图片的哪个坐标开始显示
int xx; int yy;
//背景移动的速度
int speed;
};
struct bk bk1 = { 1000,0,5 };
struct p1_pos
{
//带土的开始显示在窗口上的坐标
int x;
int y;
int speed; //带土的移动速度
};
struct p1_pos Obito = { 200, 400, 20 };
int player1flagbt_dt = 0, player1flagAD = 1, player1flagK = 0, player1flagS = 0, player1flagJ = 0, jumpnum1 = 0, player1flagL = 0, player1flagU = 0, player1flagbt = 0, player1flagI = 0, player1flagO = 0, player1flagW = 0, player1yz = 0, player1blood = 526;
int player2flagbt_dt = 0, player2flagAD = -1, player2flagK = 0, player2flagS = 0, player2flagJ = 0, jumpnum2 = 0, player2flagL = 0, player2flagU = 0, player2flagbt = 0, player2flagI = 0, player2flagO = 0, player2flagW = 0, player2yz = 0, player2blood = 526;
int player1select = 0, player2select = 0;//1佩恩|2鸣人
int x_head1 = 95, y_head1 = 95, x_head2 = 1295, y_head2 = 95;//选框位置
int flag1 = 1, flag2 = 1;
int x = 0, y = 0;
int bkselect;//地图
int width = 1500, high = 800;//画布大小
int esc = 0;
int flagi = 1;
float position_x, position_y;
char input;
void bkmusic()
{
}
void background()
{
loadimage(&img_bk, _T("D:\\战斗地图\\background1.jpg"),3450,800);
loadimage(&img_blood2, _T("D:\\战斗地图\\血条2.jpg"));
loadimage(&img_blood1, _T("D:\\战斗地图\\血条1.jpg"));
loadimage(&img_blood, _T("D:\\战斗地图\\1血量.jpg"));
loadimage(&img_blood_head_left1, _T("D:\\战斗地图\\血条头像1左.jpg"));
loadimage(&img_blood_head_right1, _T("D:\\战斗地图\\血条头像1右.jpg"));
}
void blood()
{
int i;
if (player1select == 1)
loadimage(&img_blood_head_left2, _T("D:\\战斗地图\\佩恩血条头像左.jpg"));
else if (player1select == 2)
loadimage(&img_blood_head_left2, _T("D:\\战斗地图\\鸣人血条头像左.jpg"));
else if (player1select == 3)
loadimage(&img_blood_head_left2, _T("D:\\战斗地图\\千手柱间血条头像左.jpg"));
else if (player1select == 4)
loadimage(&img_blood_head_right2, _T("D:\\战斗地图\\带土血条头像左.jpg"), 153, 100);
if (player2select == 1)
loadimage(&img_blood_head_right2, _T("D:\\战斗地图\\佩恩血条头像右.jpg"));
else if (player2select == 2)
loadimage(&img_blood_head_right2, _T("D:\\战斗地图\\鸣人血条头像右.jpg"));
else if (player2select == 3)
loadimage(&img_blood_�
评论0