c语言推箱子 把下面的一个关卡的推箱子游戏改成多关游戏环境(wintc) 100
代码如下:#include<stdio.h>#include<bios.h>#include<conio.h>#defineESC0x011b#defineUP0x480...
代码如下:
#include <stdio.h>
#include <bios.h>
#include <conio.h>
#define ESC 0x011b
#define UP 0x4800
#define DOWN 0x5000
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define MAXSIZE 10
typedef struct
{
int x;
int y;
}point;
point des[MAXSIZE];
char map1[10][10] =
{
" ",
" ####",
" ### @#",
" # b #",
" ## # ###",
" # # #*#",
" # # b*#",
" # b *#",
" ########",
" "
};
char map2[10][10] =
{
" ",
" ####",
" ### @#",
" # b #",
" ## # ###",
" # # #*#",
" # # b*#",
" # b *#",
" ########",
" "
};
void DrawMan(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(YELLOW);
putch(2);
printf("\b");
}
void DrawSpace(int x, int y)
{
gotoxy(x+10, y+5);
printf(" ");
}
void DrawBox(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(CYAN);
putch('@');
}
void DrawDes(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(YELLOW);
putch('*');
}
void DrawBoxIn(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(YELLOW);
putch('@');
}
我把详细代码发在我空间:
第一段http://hi.baidu.com/%D4%B5%C0%B4%CA%CC%CE%D2/blog/item/314606d836899a2611df9b9a.html
第二段http://hi.baidu.com/%D4%B5%C0%B4%CA%CC%CE%D2/blog/item/01645e86150af820c65cc39a.html
谢谢大家 展开
#include <stdio.h>
#include <bios.h>
#include <conio.h>
#define ESC 0x011b
#define UP 0x4800
#define DOWN 0x5000
#define LEFT 0x4b00
#define RIGHT 0x4d00
#define MAXSIZE 10
typedef struct
{
int x;
int y;
}point;
point des[MAXSIZE];
char map1[10][10] =
{
" ",
" ####",
" ### @#",
" # b #",
" ## # ###",
" # # #*#",
" # # b*#",
" # b *#",
" ########",
" "
};
char map2[10][10] =
{
" ",
" ####",
" ### @#",
" # b #",
" ## # ###",
" # # #*#",
" # # b*#",
" # b *#",
" ########",
" "
};
void DrawMan(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(YELLOW);
putch(2);
printf("\b");
}
void DrawSpace(int x, int y)
{
gotoxy(x+10, y+5);
printf(" ");
}
void DrawBox(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(CYAN);
putch('@');
}
void DrawDes(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(YELLOW);
putch('*');
}
void DrawBoxIn(int x, int y)
{
gotoxy(x+10, y+5);
textcolor(YELLOW);
putch('@');
}
我把详细代码发在我空间:
第一段http://hi.baidu.com/%D4%B5%C0%B4%CA%CC%CE%D2/blog/item/314606d836899a2611df9b9a.html
第二段http://hi.baidu.com/%D4%B5%C0%B4%CA%CC%CE%D2/blog/item/01645e86150af820c65cc39a.html
谢谢大家 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询